This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: "format not a string literal"
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: "format not a string literal"
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 14 Oct 1999 10:14:01 -0700
- Cc: eliz at gnu dot org, egcs-patches at egcs dot cygnus dot com, gcc-bugs at sourceware dot cygnus dot com
- References: <199910141700.NAA28874@caip.rutgers.edu>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
"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 `------------------------