Apple clang 支持中文字符命名的 macro

2017-01-08 08:33:41 +08:00
 frjalex

其实 c11 标准里面就有写了,但似乎 gcc 不支持. 有了这个功能可以搞些很奇怪的东西,例如 C in Chinese: https://github.com/thefangbear/yiic 测试了下,clang 支持的很好.

参考: 1 - gcc wiki : GCC only supports UCNs but not Unicode macro names: https://gcc.gnu.org/PR67224

2 - https://gcc.gnu.org/wiki/FAQ#What_is_the_status_of_adding_the_UTF-8_support_for_identifier_names_in_GCC.3F

3 - http://stackoverflow.com/questions/32799078/why-doesnt-these-unicode-variable-names-work-with-fextended-identifiers

4 - http://stackoverflow.com/questions/12692067/and-other-unicode-characters-in-identifiers-not-allowed-by-g?noredirect=1&lq=1

5 - http://stackoverflow.com/questions/4739776/c-universal-macro-names-gcc-fextended-identifiers?noredirect=1&lq=1

6 - http://stackoverflow.com/a/34315237

1961 次点击
所在节点    C
7 条回复
Arnie97
2017-01-08 10:27:08 +08:00
马洛个???
另外,运算符为什么要翻译成汉字…
aristotll
2017-01-08 10:44:59 +08:00
易语言的特性....
frjalex
2017-01-08 13:05:25 +08:00
@Arnie97 malloc 直译啊,是不是很喜感
fy
2017-01-08 17:09:10 +08:00
为什么你们随手撸个玩具都会仔细设计一个 logo 啊,咸鱼瑟瑟发抖
ejq
2017-01-08 18:27:45 +08:00
你的亿少打了一个 0
Karblue
2017-01-08 22:37:20 +08:00
易语言瑟瑟发抖
Arnie97
2017-01-10 22:45:42 +08:00
@frjalex 不应该翻译成「分配内存」么, Memory ALLOCation

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/333002

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX