This is the mail archive of the gcc-bugs@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" <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   `------------------------

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