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: drepper at cygnus dot com
- Subject: Re: "format not a string literal"
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Tue, 12 Oct 1999 10:38:33 -0400 (EDT)
- Cc: aj at suse dot de, egcs-patches at egcs dot cygnus dot com, gcc-bugs at sourceware dot cygnus dot com, raeburn at raeburn dot org
> 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