This is the mail archive of the
mailing list for the GCC project.
Re: Preparsing sprintf format strings
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 12 Oct 2007 14:49:01 +0200
- Subject: Re: Preparsing sprintf format strings
- References: <20071012122613.29AF473D0B@caffeine.csclub.uwaterloo.ca>
Andreas Schwab writes:
The compiler is supposed to know the encoding of the strings.
The compiler can't in general know what encoding that printf, fprintf,
and sprintf will use to parse the string. It's locale dependent.
It is undefined what happens if you run a program in a different charset
than in the one you specified for -fexec-charset. (locale != charset).
A google code search for printf.*\\x1[bB][($].*%s hints that this is not
a problem in practice.