From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29759 invoked by alias); 19 Jun 2005 20:58:31 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 29751 invoked by uid 22791); 19 Jun 2005 20:58:27 -0000 Received: from s0106000476618092.vc.shawcable.net (HELO thinkpaddie.zlew.org) (24.81.29.117) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 19 Jun 2005 20:58:27 +0000 Received: from thinkpaddie (thinkpaddie [127.0.0.1]) by thinkpaddie.zlew.org (Postfix) with ESMTP id 70C271C203 for ; Sun, 19 Jun 2005 22:58:02 +0200 (CEST) From: Tommy Vercetti To: gcc@gcc.gnu.org Subject: Re: c/c++ validator Date: Sun, 19 Jun 2005 20:58:00 -0000 User-Agent: KMail/1.8.50 References: <200506190024.18033@gj-laptop> <42B4D584.5080800@nycap.rr.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506192258.00250@gj-laptop> X-SW-Source: 2005-06/txt/msg00849.txt.bz2 On Sunday 19 June 2005 04:48, Gabriel Dos Reis wrote: > Mathieu Malaterre writes: > | Gabriel Dos Reis wrote: > | > Tommy Vercetti writes: > | > | On Sunday 19 June 2005 03:03, you wrote: > | > | > Elsa does not parse C++. > | > | > | > | Elsa is for C/C++, so it says on their website. > | > > | > I know what the website says. My comment was about the actual *uses* > | > of the parser. Have you tried it on actual C++ programs? They claim it does compile qt, and they work on making it compile KDE. That's enough for me. On free software "market" there is lack of good static checker/validator of c++ code. I was looking on different ones, for C, that claimed to have ability to find security problems. One that I found the best, is splint. But it's still not able to find such obvious problem: char a[10]; for( unsigned int i; i< 100 ; i++ ) { a[i]=a[i]+1; } Even thou, it analyzes buffers, and other stuff. So... Plus it can't do that for c++. It shouldn't be so hard, if they have code that gathers so much information already, and can find infinite loops, even not easy cases.. Elsa parses c++ code well enough for me, to at least try to write some code that will do something like that. Elsa thou has one potential problem, it's on bsd licence. Licence issues sux. You can't take some code from splint, and stick it into bsd code. I guess, but I maybe wrong. I don't even think that it will work from design point of view. > | How about gccxml: > | > | http://www.gccxml.org > > It is a not C++ parser :-) -- if you're interested in function bodies > and other more fundamental things, you lose. It suffers from the same > problems (at least ones we've found quite annoying) of using GCC > currently: too much of low-level stuff directly geared to code > generation as understood by GCC now, and C++ programs are not > represented at the most abstract level (contrast that with a > celebrated C++ front-end on the market). And it also shares problems > with Elsa, no real support for templates (although the case of Elsa is > slightly "worse" :-)). Now, if you're just interested in simple > "toplevel" decls, then that might be fine :-) gccxml parser is a good idea maybe, but I don't think it's good for what I am looking for. -- Vercetti