This is the mail archive of the gcc@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: revised proposal for GCC and non-Ascii source files


   Date: Wed, 30 Dec 1998 17:58:17 -0500
   From: Zack Weinberg <zack@rabi.columbia.edu>

   - C9x CD2 unambiguously says \u and \U escapes are to be treated as
   Unicode.  It also disallows these escapes for certain ranges of
   Unicode which encompass all of 7-bit ASCII.  That being so, I
   propose to encode \u and \U in UTF-8 always.

For UTF-8 locales this is reasonable, but it doesn't work for
non-UTF-8 locales, which is the main point of my revised proposal.
For such locales, your proposal would map UCNs to one encoding, while
the rest of the program would continue to use an incompatible encoding
-- but this would render UCNs useless, as you normally can't mix
encodings like that.

   This can be done regardless of the availability of translation
   libraries.

If translation libraries are not available, then GCC can and should
fall back to something along the lines that you propose.  I call this
fallback behavior the ``GNUC charset'' (soon to be revised to the
``GNUC ctype'') in my proposal.

   pragmas affecting the preprocessor (which this is) cannot be
   expressed with _Pragma() at all, and neither #pragma nor _Pragma()
   can appear in a position that is inconvenient to the parser -- I
   think that will translate to "must look like a C
   statement-or-declaration".

I missed your message (as I don't get egcs) but will look into it in
the egcs archives.  However, even ``must look like a C
statement-or-declaration'' is overly optimistic, since a
charset-changing pragma can change the interpretation of comments.  I
see real problems in implementing a charset-changing pragma without
placing draconian restrictions on it.


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