Bryan O'Donoghue wrote:
> Inhabitants of ILUG.. lower your shields and surrender your vessels...
>> ...Greetings !
>> What do people out there in ILUG land use, or recommend to use, as a
> lint type scource code checker ?
>> splint, (*)lint ? Is there a semi-universally accepted obvious choice (tm) ?
I tried splint (3 years ago) and thought it wasn't great.
Previoiusly I used flexelint: http://www.gimpel.com/ and
thought it was great.
valgrind is a related tool which is excellent.
> Ideally, I'd like a tool which could intercept the following.
>> char x;
> memset(x, 0x0,20); ?
Note a common error related to that is to switch the
last 2 arguments to memset. ( grep 'memset.*0[^,]*)' ):
Note the comment at the bottom there that newer gcc/glibc's
issue a warning for this.
> Be that a runtime piece of magic software... else... a source code
> parser, with some damn good (tm) context awareness.
>> Disclaimer : I've never used lint... but, people keep raving about it to
> me. For the case above valgrind emphatically won't catch that error, or
> if it will, I don't know the correct runtime incantation to make it do so.
You get some of lint's functionality by using the -Wall gcc option,
and this will get better as commented above.
Personally I find -Wall + valgrind adequate.
Pádraig Brady - http://www.pixelbeat.org
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!