This is the mail archive of the 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]
Other format: [Raw text]

Re: Universal Character Names, v2

Geoff Keating <> 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:

                       . digit
                       pp-number digit
                       pp-number identifier-nondigit
                       pp-number e sign
                       pp-number E sign
                       pp-number p sign
                       pp-number P sign
                       pp-number .
and then

                       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
> processing.

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
reasonable uses:
- 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,


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