__PTRDIFF_TYPE__的默认值 [英] default value of __PTRDIFF_TYPE__

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

问题描述

我看到它是合法的使用变量 __ __ PTRDIFF_TYPE 无头包容。

I see it is legal to use the variable __PTRDIFF_TYPE__ with no header inclusion.

我试图寻找这个变量名 ISO / IEC 9899 ,但它不会出现。我期望看到在第七部分的定义,C库。

I tried to look for this variable name in ISO/IEC 9899 but it does not appear. I expected to see its definition in the 7th part, C library.

为什么是合法的吗?

我使用在Linux / GNU gcc的。

I am using the gcc under Linux/GNU.

推荐答案

这是海湾合作委员会中的一个predefined宏(一个GNU C扩展);看到 https://gcc.gnu.org/onlinedocs/cpp /Common-$p$pdefined-Macros.html

This is a predefined macro in gcc (a GNU C extension); see https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html.

至于为什么这是合法的:该标准保留所有名称以两个下划线(并开始以下划线后跟一个大写字母所有名称),供实施使用,所以GCC可以predefine __任何,仍然遵循标准。

As for why this is legal: The standard reserves all names starting with two underscores (and all names starting with an underscore followed by an uppercase letter) for use by the implementation, so gcc could predefine __whatever and still follow the standard.

这篇关于__PTRDIFF_TYPE__的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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