PDA

View Full Version : Which lint tool for Linux



RolandHughes
1st January 2015, 20:21
Which lint tool for Linux are people using now with Qt? Back in the day of DR DOS and Pen DOS and OS/2 I used to use Gimple's PC-Lint. I just looked at their site and it appears they want around a grand for the FlexLint version of the product. That's a bit much for an embedded Linux project. I was assuming it would be around the $400 price tag it used to be for DOS. Bad assumption.

What are people here using? I used to think the "linting" ability of the GNU compilers was "good enough" but no more. I just spent hours tracking down a crash caused by a divide by zero error in this project. It was a modulo operation using a class member variable as the divosr without a zero_check before the operation. I imagine, given the size/scope/number of developers/length of this project quite a few other land mines like this are in the code. Really too difficult to search for % and / in the source with the IDE. Well, too difficult unless I can saddle an intern with the task on Monday. The % search was thousands of hits, most of which are in old C code print format logic.

Thanks,

kaufenpreis
3rd January 2015, 09:29
I choose the gcc as the compiler for QT using PC-LINT configuration tool.

midi-pascal
13th January 2015, 14:59
What about cppcheck for static source checking?
http://cppcheck.sourceforge.net

Very efficient and a big time saver.

For dynamic checking, Valgrind is a life saver and as a bonus it is integrated in Qt Creator (if installed).

wysota
13th January 2015, 15:02
cppcheck can also be easily integrated with Qt Creator, just add a new build step and invoke cppcheck with --template=gcc to get warnings integrated into the issues tab in Creator.