Re: PSA: If you are C/C++ developer, use cppcheck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi


On Tue, Dec 17, 2013 at 12:36 PM, Dan Williams  wrote:
On Tue, 2013-12-17 at 12:17 -0500, Rahul Sundaram wrote:
> Hi
>
> In the last few days, I have been running cppcheck on quite a few programs
> including systemd, transmission, libvirt,  ndjbdns etc and cppcheck has
> found real and potential bugs (null pointer dereferences, uninitialized
> variables, memory & resource leaks etc) in each of them.  I have reported
> the ones I found and several developers have already fixed the issues.   A
> couple of examples

How are you running it to get it to print the warnings?  I've tried
--enable=warning, but all I get are includes errors (like <errno.h>)
that aren't useful and are wrong AFAICT.

Sorry.  I should have specified that explicitly in my first mail.   The simplest check is merely running

cppcheck  . --quiet

You can run more extensive checks by using something like

cppcheck --enable=all --inconclusive --std=posix

The latter tends to return a lot more false positives  but does find some more real bugs as well. 

Rahul
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux