This is the mail archive of the
mailing list for the GCC project.
Re: Universal Character Names, v2
Geoff Keating <email@example.com> writes:
> Is this intended to be an extension to C99? I think it is; C99
> doesn't support things that start with digits and then contain
> non-digits (as specified by C99) in them.
It sure does. Consider 6.4.8:
pp-number e sign
pp-number E sign
pp-number p sign
pp-number P sign
and then 18.104.22.168:
other implementation-defined characters
So UCNs in pp-numbers are supported in the language. Same for C++.
[disclaimer: this is again from my C99 draft. If the final version
is different, please let me know. For C++, I'm certain that UCNs
are allowed in pp-numbers ]
> I believe that support for more kinds of digit was explicitly
> considered and rejected by the C standards committee, on the grounds
> that (a) it provides no useful functionality, and (b) it makes it
> harder to process C source files without having a full C tokenizer,
> because now even recognizing the start of a number requires full UCN
No. You cannot start a pp-number with a UCN. I'm not sure what the
rationale is for allowing nondigits in a number, but I found two
- you may want to paste a pp-number to an identifier to get another
- you can use the preprocessor to support different languages. For
example, OMG IDL uses a "D" (or "d") suffix to denote fixed-point
numbers, and specifies that the ISO 14882 preprocessor is used.
Thanks for your comments,