trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cppcheck mentions format string error
@ 2014-01-08 18:52 Toralf Förster
  2014-01-08 19:04 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Toralf Förster @ 2014-01-08 18:52 UTC (permalink / raw)
  To: trinity

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 ?

-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cppcheck mentions format string error
  2014-01-08 18:52 cppcheck mentions format string error Toralf Förster
@ 2014-01-08 19:04 ` Dave Jones
  2014-01-08 19:34   ` Toralf Förster
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2014-01-08 19:04 UTC (permalink / raw)
  To: Toralf Förster; +Cc: trinity

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cppcheck mentions format string error
  2014-01-08 19:04 ` Dave Jones
@ 2014-01-08 19:34   ` Toralf Förster
  2014-01-20 22:00     ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Toralf Förster @ 2014-01-08 19:34 UTC (permalink / raw)
  To: Dave Jones; +Cc: trinity

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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>

- -- 
MfG/Sincerely
Toralf Förster
pgp finger print:1A37 6F99 4A9D 026F 13E2 4DCF C4EA CDDE 0076 E94E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlLNqEkACgkQxOrN3gB26U5kggD+IB2GXXByWJhXuQxZ/KBLpNQk
8uKd0/estsOegrJ9G/kA/2e4sCfDRL0OZlvOSqYPgtQFXiikQDf5ne5jo0ZkPtVg
=EP9s
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: cppcheck mentions format string error
  2014-01-08 19:34   ` Toralf Förster
@ 2014-01-20 22:00     ` Dave Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jones @ 2014-01-20 22:00 UTC (permalink / raw)
  To: Toralf Förster; +Cc: trinity

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-20 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 18:52 cppcheck mentions format string error Toralf Förster
2014-01-08 19:04 ` Dave Jones
2014-01-08 19:34   ` Toralf Förster
2014-01-20 22:00     ` Dave Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).