RFC: should we use -Werror? (& sample patch to do it)

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Wed Sep 5 12:09:00 GMT 2001


 > From: Zack Weinberg <zack@codesourcery.com>
 > 
 > >  > Next biggest offender is
 > >  > 
 > >  >        7 string length `???' is greater than the length `???' ISO C89
 > >  >          compilers are required to support
 > >  > 
 > >  > These are more or less intractable: they come from big hairy spec
 > >  > strings, e.g.
 > > 
 > > IIRC, these string warnings are from -pedantic, which isn't affected
 > > by -Werror.  To make those hard errors, I think you have to use
 > > -pedantic-errors.  (Again, IIRC.)
 > 
 > Not true.  -Werror turns _all_ warnings into errors.
 > zw

Hmm, I tested it in 3.1 and 2.95.3 and you're right.  Well, that
certainly puts a monkey wrench into my plan.

Since these are intractable as you say, what if we applied the
__extension__ keyword to these strings?  Since they are from -pedantic
that would eliminate the warning, and thus the hard error when using
-Werror, right?

Separately, perhaps we want something like __extension__ applied to
regular warnings too.  E.g. how about a __nowarn__ keyword that
temporarily does "inhibit_warnings = 1" for the statement in question?

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions



More information about the Gcc mailing list