我正在查看 google go 的运行时源代码(位于https://go.googlecode.com/hg/src/pkg/runtime/),而且他们似乎使用了一个特殊字符作为函数名称,·。 (例如,查看https://go.googlecode.com/hg/src/pkg/runtime/cgocall.c)。主要编译器是否接受这一点?这不是 ANSI C,是吗?或者这只是一些宏观魔法?
谢谢你!
C90 不允许在标识符中使用附加字符(超出基本字符集中的字符),而 C99 则允许(均使用通用字符语法 - \uXXXX 和 \UXXXXXXXX - 以及实现定义的其他字符集)。
C99 中的 6.4.2.1/1:
identifier:
identifier-nondigit
identifier identifier-nondigit
identifier digit
identifier-nondigit:
nondigit
universal-character-name
other implementation-defined characters
nondigit: one of
_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
digit: one of
0 1 2 3 4 5 6 7 8 9
我不知道 C 实现对它的支持程度如何,我知道 Plan9 C 编译器可以处理其他字符在标准化之前。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)