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"


 > From: Ulrich Drepper <drepper@cygnus.com>
 >  
 > "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
 >  
 > >       Does this gcc patch help out?  I'd be interested to know if
 > > any other false positives remain.
 >  
 > This solves the obvious problems.  There is still case:
 >  
 >         printf (gettext ("%s %d"), "foo", 42);
 >  
 > you have to take the functions registered using
 > `record_international_format' into account.


	Eh?  Did you actually try this?  I don't see a problem.


 > % gcc -v
 > Reading specs from /var/tmp/gcc-testing/build/gcc/specs
 > gcc version 2.96 19991008 (experimental)
 > 
 > % cat foo.c
 > 
 > #include <stdio.h>
 > extern char *gettext (const char *__msgid);
 > int main()
 > {
 >   printf (gettext("%s %d"), "foo", 42);
 >   return 0;
 > }
 > 
 > % gcc -c -W -Wall -Wformat foo.c
 > %


The code to find the format string in intl functions occurs before the
literal string check.  Please try rebuilding glibc with my gcc patch
and tell me of actual false positives with a code sample known to fail.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


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