This is the mail archive of the
mailing list for the GCC project.
Re: ISO C90 checking but ignoring 64-bit printf/scanf warnings
- From: Tom St Denis <tstdenis at ellipticsemi dot com>
- To: Jeroen Massar <jeroen at unfix dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 08 Nov 2007 09:19:51 -0500
- Subject: Re: ISO C90 checking but ignoring 64-bit printf/scanf warnings
- References: <email@example.com>
Jeroen Massar wrote:
I am compiling generally with:
CFLAGS += -W -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline
-Wbad-function-cast -fshort-enums -fstrict-aliasing -fno-common
-Wno-packed -Wpadded -pedantic -Wall -Wmissing-include-dirs
-Wswitch-default -Wformat=2 -Wformat-security -Wformat
-Wmissing-format-attribute -D_REENTRANT -D_THREAD_SAFE -pipe -combine
-Wunused -Winit-self -Wextra
Adding "-pthread -Wno-variadic-macros" on some platforms and also the
-m64 when the target is a 64bit platform, next to "-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" to make everything (afaik,
tips/comments welcome :) as much 64 bit as possible and getting as many
warning as possible so that everything which seems a bit off will be caught.
The annoying thing is though that I also get a lot of:
warning: ISO C90 does not support the 'll' scanf length modifier
warning: ISO C90 does not support the 'll' printf length modifier
because of the -pedantic and -Wformat options. Now the question is, is
there a way to let gcc ignore the above two warnings, thus in effect
checking for ISO C90 + "ll" format?
Or would the gcc developers accept a patch for such an option if it is
not in there? Without those two warnings my app compiles clean, ripping
those two warnings out though can't be accomplished with a simple grep
and thus I think would require source changes.
I don't get the question. If ISO C90 doesn't mandate support for ll
what's wrong with the warning?
More so, why are you hell-bent on conforming to C90 then requesting that
it ignore standards violations?
Anyways, on a 64-bit platform %ld/%lu should print a 64-bit value since
for most of these "long" is a native register size.