gcc compiler __SIZE_TYPE__

做~自己de王妃 提交于 2019-12-10 16:29:40

问题


I'm curious about the variable __SIZE_TYPE__ which is predefined by gcc compiler.

Suppose that I coded like following sentence in C

typedef __SIZE_TYPE__ size_t; 

Is there any possibility that an error occurs when I use another C compiler excluding gcc? Do all C compilers have the variable __SIZE_TYPE__?


回答1:


Yes, it is possible that an error occurs as soon as you use any identifier with double underscore. See the C standard 7.1.3:

All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.

As for __SIZE_TYPE__ that's apparently a gcc identifier. I don't think any other compiler uses it, but there are no guarantees. Another compiler is perfectly free to use the same identifier even for an entirely different purpose.



来源:https://stackoverflow.com/questions/36857141/gcc-compiler-size-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!