gcc编译器__SIZE_TYPE__ [英] gcc compiler __SIZE_TYPE__

查看:276
本文介绍了gcc编译器__SIZE_TYPE__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇gcc编译器预定义的变量 __ SIZE_TYPE __

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

假设我编码就像下面C语句中的句子一样

Suppose that I coded like following sentence in C

typedef __SIZE_TYPE__ size_t; 

当我使用另一个不包含gcc的C编译器时,是否有可能发生错误?
所有的C编译器都有变量 __ SIZE_TYPE __

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__?

推荐答案

是的,只要您使用任何带有双下划线的标识符,就可能发生错误。查看C标准7.1.3:

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.

至于 __ SIZE_TYPE __ 这显然是一个gcc标识符。我不认为其他编译器使用它,但是没有保证。另一个编译器可以完全自由地使用相同的标识符,甚至用于完全不同的目的

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.

这篇关于gcc编译器__SIZE_TYPE__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆