Re: cppcheck mentions format string error

Dave Jones <[email protected]>
Newsgroups org.kernel.vger.trinity
Message-ID <[email protected]>
On Wed, Jan 08, 2014 at 08:34:33PM +0100, Toralf Förster wrote:
 
 > On 01/08/2014 08:04 PM, Dave Jones wrote:
 > > On Wed, Jan 08, 2014 at 07:52:02PM +0100, Toralf Förster wrote:
 > >> heise.de reported about a security flaw in xorg-server found by
 > >> cppcheck - so I just gave it a try.
 > >> 
 > >> It reports :
 > >> 
 > >> ~/devel/trinity $ cppcheck ./ --force --quiet [devices.c:90]:
 > >> (warning) %a in format string (no. 2) requires 'float *' but the
 > >> argument type is 'char * *'.
 > >> 
 > >> 
 > >> Is it correct ?
 > > 
 > > no. Looks like it doesn't understand the gnu %as extension, and
 > > thinks it's %a followed by 's'.
 > > 
 > > That extension isn't C99, but given portability isn't really a goal
 > > for trinity, I'm not overly bothered by it.
 > > 
 > > Dave
 > > 
 > > 
 > ok
 > 
 > FWIW I created an enhancement request for cppcheck :
 > 
 > Ticket URL: <http://sourceforge.net/apps/trac/cppcheck/ticket/5329>

I'm not sure why I never noticed before, but after upgrading some packages
this last week, suddenly gcc and llvm are both warning about it.
After filing a bug on what I thought was a gcc bug, Jakub suggested
switching to %ms, which should make things happier, including cppcheck.

strange.

	Dave
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.