Does C99 permit universal character names in identifiers?
c, c99, language-lawyer
Solution
None of those three. It's simply a long-standing unimplemented (or rather, only partially implemented) feature. It's recently been completed, and will be available in GCC 5. Prior to that version, you can use the `-fextended-identifiers` command-line option, but there are some cases that it got wrong that led to it not being enabled by default.
You can see this listed on Status of C99 features in GCC.
Problem
From §6.4.2 of the WG14/N1124 draft of the C99 spec, "Identifiers": ``` identifier: identifier-nondigit identifier identifier-nondigit identifier digit identifier-nondigit: nondigit universal-character-name other implementation-defined characters ``` And §6.4.3, "Universal character names": ``` universal-character-name: \u hex-quad \U hex-quad hex-quad ``` This seems to suggest that an identifier like `foo\u00AAbar` is valid according to the grammar. I can't find anything in the semantics that would suggest otherwise. Yet GCC rejects such an identifier without even trying to parse it: ``` <stdin>:2: error: stray ‘\’ in program <stdin>:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u00AAbar’ <stdin>:2: error: ‘u00AAbar’ undeclared (first use in this function) ``` Is this an oversight in GCC, the C99 standard, or my reasoning?