[Bug c/40065] spurious format string warnings

2009-05-14 Thread joseph at codesourcery dot com


--- Comment #5 from joseph at codesourcery dot com  2009-05-14 12:01 ---
Subject: Re:  spurious format string warnings

On Thu, 14 May 2009, bje at gcc dot gnu dot org wrote:

 Andrew wrote:
 
   GCC can assume %qE means anything from just printing E in quotes
 
 Can you explain this?  Is it really the case that the format specifier can 
 have
 an optional argument?

This is not a meaningful question.  There are no limits on the possible 
semantics of a format string; a variadic function can apply arbitrary 
Turing-complete computations to its fixed arguments to determine the types 
of the variable arguments, and to the first N variable arguments to 
determine the type of argument N+1.  GCC can only warn about strings not 
following the rules for a particular type of format that were built into 
GCC; if you compile code with a string intended for different, newer 
rules, as here, it cannot have any idea what the newer rules are and thus 
whether %E takes no arguments (like %%), one, two or more.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065



[Bug c/40065] spurious format string warnings

2009-05-14 Thread bje at gcc dot gnu dot org


--- Comment #6 from bje at gcc dot gnu dot org  2009-05-14 21:12 ---
Not a bug.


-- 

bje at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065



[Bug c/40065] spurious format string warnings

2009-05-13 Thread bje at gcc dot gnu dot org


--- Comment #4 from bje at gcc dot gnu dot org  2009-05-14 01:01 ---
Andrew wrote:

  GCC can assume %qE means anything from just printing E in quotes

Can you explain this?  Is it really the case that the format specifier can have
an optional argument?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065



[Bug c/40065] spurious format string warnings

2009-05-08 Thread joseph at codesourcery dot com


--- Comment #3 from joseph at codesourcery dot com  2009-05-08 10:19 ---
Subject: Re:  spurious format string warnings

On Fri, 8 May 2009, pinskia at gcc dot gnu dot org wrote:

 is happening here, it is assuming %qE does not take an argument).  I don't see
 an issue really except you really should be compiling a cross compiler with 
 the
 same version as you are building.  I thought that was mentioned somewhere too.

There is no such requirement (save maybe to some extent for Ada), it's 
just that you may get extra warnings using another version, or in stage 1 
of a bootstrap (which deliberately does not use -Werror).  It's the 
build-x-target compiler when build != host that must be the same version 
as the host-x-target compiler you are building, not the build-x-host or 
build-x-build compiler.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065



[Bug c/40065] spurious format string warnings

2009-05-07 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2009-05-08 05:22 ---
GCC can assume %qE means anything from just printing E in quotes (which is what
is happening here, it is assuming %qE does not take an argument).  I don't see
an issue really except you really should be compiling a cross compiler with the
same version as you are building.  I thought that was mentioned somewhere too.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065



[Bug c/40065] spurious format string warnings

2009-05-07 Thread bje at gcc dot gnu dot org


--- Comment #2 from bje at gcc dot gnu dot org  2009-05-08 05:38 ---
I've been building cross-compilers for a long time and I have never heard that!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065