config patch to turn off -Wformat for systems that include it in -Wall

Mike Stump mikestump@comcast.net
Sat Mar 27 19:27:00 GMT 2010


On Mar 26, 2010, at 5:10 AM, Joseph S. Myers wrote:
> On Thu, 25 Mar 2010, Mike Stump wrote:
> 
>> This patch tuns off -Wformat for systems that include it in -Wall.  
>> Apple's gcc would be one such system.  On other systems, this shouldn't 
>> have any effect.  I originally wanted to put this into config/mh-darwin, 
>> but those flags come before -Wall on the command line and hence can't 
>> effect it.
> 
> Standard FSF GCC includes -Wformat in -Wall and we have -Wformat 
> functionality *specifically and solely present for use in building GCC*, 
> so this patch is quite definitely wrong and will inevitably lead to many 
> bugs being introduced into GCC.  Perhaps you could explain the actual 
> problem you are trying to fix.

Ah, slightly subtler that I expected.  Between gcc-4.2.1 and top of the tree, %< %> and %K are handled differently.  gcc-4.2.1 produces:

../../gcc/gcc/expr.c:9229: warning: unknown conversion type character ‘K’ in format
../../gcc/gcc/expr.c:9229: warning: too many arguments for format

while the exact same .i file with the top of the tree does not.  So much for forward compatibility I guess.  This is more a polish issue, I can just stage1 with a newer gcc to avoid these, which has other benefits as well.



More information about the Gcc-patches mailing list