cppcheck?

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Jan 15 15:06:54 UTC 2014


On Wed, 15 Jan 2014, Thiago Macieira wrote:
> 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.

Well, what can I say?  You sure know better.


Cheers,

-- 
Cristian


More information about the subsurface mailing list