This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c/c++ validator
On Sunday 19 June 2005 04:48, Gabriel Dos Reis wrote:
> Mathieu Malaterre <mmalater@nycap.rr.com> writes:
> | Gabriel Dos Reis wrote:
> | > Tommy Vercetti <vercetti@zlew.org> 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