"format not a string literal"

Ulrich Drepper drepper@cygnus.com
Thu Oct 14 10:17:00 GMT 1999

"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:

> Also according to Ulrich, calling ?: in a format string is not good
> from an intl perspective.  So in general its best to fix these cases.

No, this is not what I said.  There are many situations where this
kind of calls is useful and correct.  It is simply unacceptable that
the compiler tries to enforce the a certain programming style.  The
-Wformat option simply means "do your best" and there is no
requirement to verify all calls.  Heck, I even construct often format
strings.  I guess you would call this bad practice as well.

Simply leave the compiler out of this kind of business.  Even if you
cannot think about any useful use, others might.  You should be humble
in this respect and not in an arrogant way demand that everybody
follows your "guidelines" of writing good C code.

---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

More information about the Gcc-bugs mailing list