cppcheck?

Thiago Macieira thiago at macieira.org
Wed Jan 15 12:16:27 UTC 2014


On quarta-feira, 15 de janeiro de 2014 19:17:43, Cristian Ionescu-Idbohrn > 	
$ cppcheck -q -f --std=posix .
> 	[file.c:73]: (error) Common realloc mistake: 'mem' nulled but not freed
> upon failure 
> [planner.c:404]: (error) Common realloc mistake: 'gaschanges'
> nulled but not freed upon failure 
> [profile.c:135]: (error) Common realloc
> mistake: 'ev_namelist' nulled but not freed upon failure 

True errors, but pointless. We assume that malloc() and realloc() always 
succeed in userspace.

> [uemis.h:46]: (error) syntax error

__attribute((packed))

Tool bug.

> 	[qt-ui/modeldelegates.cpp:67] -> [qt-ui/modeldelegates.h:37]: (warning)
> Call of pure virtual function 'revertModelData' in constructor.
> [qt-ui/subsurfacewebservices.cpp:216] -> [qt-ui/subsurfacewebservices.h:29]:
> (warning) Call of pure virtual function 'buttonClicked' in constructor. 
> [qt-ui/subsurfacewebservices.cpp:217] -> [qt-ui/subsurfacewebservices.h:27]:
> (warning) Call of pure virtual function 'startDownload' in constructor. 
> [qt-ui/subsurfacewebservices.cpp:218] -> [qt-ui/subsurfacewebservices.h:28]:
> (warning) Call of pure virtual function 'startUpload' in constructor.

Tool bug. There's no call to the pure virtual function there, only a signal-
slot connection.

Or the tool is actually smart enough to read through Qt connection mechanism 
and detects that we did connect to a pure virtual slot. However, the bug 
doesn't happen on connection, but only if we emitted the signal from within 
the constructor. So it would be a false positive.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140115/edb3bbdc/attachment.sig>


More information about the subsurface mailing list