"format not a string literal"

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sun Oct 31 23:03:00 GMT 1999


 > From: Ulrich Drepper <drepper@cygnus.com>
 > Date: 14 Oct 1999 10:14:01 -0700
 >  
 > "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.


Please, let's tone it down a bit.  I'll concede I should have said
IMHO.  But you should realize gcc warnings encourage all sorts of
behavior which isn't strictly necessary to achieve legal C.

I'm not trying to force anybody to do anything, okay?  You're free to
write code which gcc can't format check.  Nothing I do can change that
regardless of whether gcc tells you about it or not.  (And given
Jeff's comments it looks like it won't.)

		--Kaveh

PS: in reference to your ?: example in 
http://egcs.cygnus.com/ml/gcc-patches/1999-10/msg00341.html
you did specifically say it is "not really good from i18n perspective"
so I don't understand your denial about that point.  
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions



More information about the Gcc-bugs mailing list