This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: thoughts on martin's proposed patch for GCC and UTF-8
To make GCC depend on the current locale for correct compilation of a
program is error-prone. If it is necessary for the handling of C code
to depend on the locale, we should have a way to specify the locale in
the source file itself--perhaps with a #-line.
But it would be much better for GCC to be independent of the locale,
as regards the behavior of the .o file at link time and at run time.
It is no great loss if debugging symbol tables depend on the locale,
but all other aspects of the generated .o file should be as close to
locale-independent as we can make them, to reduce the possibility for
things to go wrong.
Wouldn't it work for GCC to treat all byte values above 127 as part of
an identifier, and not worry about how they group into multibyte
characters? Perhaps the current locale would have something to do
with how to they look when printed in an error message, but no more
than that.
I have not been following the discussion until now--no time to study
all those messages carefully--so please forgive me if someone has
already explained a reason this cannot work. But if it merely has
some possible inconvenience for the user, the advantage of being
locale-independent could easily outweigh that. It is a very large
advantage.