[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Static code analysis (cppcheck)

From: Bolstridge, Andrew <andy.bolstridge_at_intergraph.com>
Date: Thu, 30 Jun 2011 08:44:41 +0000

> -----Original Message-----
> From: Philip Martin [mailto:philip.martin_at_wandisco.com]
> Sent: 29 June 2011 17:39
> To: Julian Foad
> Cc: Philipp Kloke; Hyrum K Wright; dev_at_subversion.apache.org
> Subject: Re: Static code analysis (cppcheck)
>
> Julian Foad <julian.foad_at_wandisco.com> writes:
>
> >> [SVN\subversion\libsvn_auth_kwallet\kwallet.cpp:203]: (style) Variable
> 'app'
> >> is assigned a value that is never used
> >> [SVN\subversion\libsvn_auth_kwallet\kwallet.cpp:273]: (style) Variable
> 'app'
> >> is assigned a value that is never used
> >
>
> To remove the warning I suppose we could drop the app variable, i.e.
>
> new QCoreApplication(...)
>
> instead of
>
> app = new QCoreApplication(...)
>
Better would be to tell cppcheck you know this is ok and to ignore it by enabling the suppression filter for this "false-positive".

Put the following on the command line : --suppress=<errorid>:kwallet.cpp:203

Easiest way to get the error id is to use the --xml output type.
You can remove the line number from that suppress command to suppress all of those errors in the file, and you can set these in a file and use --suppressions suppressions.txt

(all in chapter 6 of the manual)

Andy
Received on 2011-06-30 10:45:16 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.