[英]What are the conventions for __func functions?
I've seen a bunch of functions in Linux code named __foo. 我已经在Linux代码中看到了许多名为__foo的函数。 What does the double underscore stand for and when should it be used?
双下划线代表什么?何时使用?
It means it's a reserved identifer. 这意味着它是保留的标识符。 Both C++ 03 and C99 standard mentioned about this.
C ++ 03和C99标准都提到了这一点。
C99: C99:
7.1.3 Reserved identifiers
7.1.3保留标识符
- All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
以下划线,大写字母或另一个下划线开头的所有标识符始终保留供任何使用。
- All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.
在普通和标记名称空间中,所有以下划线开头的标识符始终保留为具有文件范围的标识符。
C++ 03: C ++ 03:
Each name that contains a double underscore (_ _) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implementation for any use.
每个包含双下划线(_ _)或以下划线后跟大写字母(2.11)开头的名称都保留给实现以供任何使用。
You can also refer to: 您还可以参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.