This is the mail archive of the
mailing list for the GCC project.
Re: Preparsing sprintf format strings
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: gcc at gcc dot gnu dot org
- Date: Fri, 12 Oct 2007 18:04:32 -0400 (EDT)
- Subject: Re: Preparsing sprintf format strings
email@example.com (Ross Ridge) writes:
> I don't think that's true, but regardless many systems have runtime
> character sets that are dependent on locale. If GCC doesn't support this,
> then GCC is broken.
Geoffrey Keating writes:
> I don't think it's unreasonable to insist that you tell the compiler a
> character set that matches the one you are using at execution time for
> string literals.
It's completely unreasonable. I should be able put whatever byte values
I want into strings literal, using octal and hexidecimal escapes if
necessary, regardless of what locale might be at runtime or what GCC
thinks the execution character set is. It would be absurd for code like
like fprintf(f, "\xFF\xFF"); to be undefined only because GCC thinks the
execution character set is UTF-8 or ASCII.