This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "format not a string literal"



Kaveh R. Ghazi writes:
 > Perhaps we leave off this behavior when invoked through -Wall but turn
 > it on when invoked through -Wformat?  I.e. we could set the variable
 > `warn_format' to either 1 or 2 like we do for other warnings and test
 > for == 2 before showing the "not a string literal" message.

I'm not sure if this is what you intented, but if you ment that
-Wformat (by itself) would turn on the new warnings and that 
-Wformat -Wall (together) would turn them off ... well I _really_
rather not have -Wall (appear) to turn off warnings.

I would rather not do it this way, and instead have a -Wformat-all
option that displays both warnings in question.

There may be makefiles that already use -Wformat that don't use -Wall,
and don't want the new warnings.  We should go screwing these makefiles
when all it takes to not screw them is a new -W flag.

I think a new flag that turns on both the old -Wformat warnings
and the new ones would be better.  I like "-Wformat-all" better than
"-Wformat-full" or "-Wformat-nonliteral", but I don't feel strongly
about the spelling.

                                             -gavin...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]