2
從C99規範的WG14/N1124草案§6.4.2, 「標識符」:C99是否允許在標識符中使用通用字符名稱?
identifier: identifier-nondigit identifier identifier-nondigit identifier digit identifier-nondigit: nondigit universal-character-name other implementation-defined characters
而且§6.4.3, 「環球人物的名字」:
universal-character-name: \u hex-quad \U hex-quad hex-quad
這似乎表明像foo\u00AAbar
這樣的標識符根據語法是有效的。我無法找到任何可能會建議的語義。然而,GCC拒絕,甚至沒有嘗試分析它這樣的標識符:
<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)
這是在GCC的監督,C99標準,還是我的推理?