我正在学习"include/asm-x86/types.h"
,我对 的含义有点困惑\__signed__
。
当我谷歌这个关键字时,我无法获得任何有用的信息。为什么不直接使用signed
而不是\__signed__
,它有什么特殊含义吗?
这用于向后兼容,当较旧的编译器无法识别signed
关键字时,会使用此类替代方案。
The difference between __signed__
and signed
is to do with namespaces. The signed
names are only available in the __KERNEL__
and not outside.
As stated at the top of the header file you mention:
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
*/
For the signed
names without underscores it states this:
/*
* These aren't exported outside the kernel to avoid name space clashes
*/
__signed__
也用于 compile with gcc -traditional
,其中关键字signed
无法识别。
不要使用 google c __signed__
,因为在搜索中会跳过特殊字符,例如__
使用 进行文字搜索c "__signed__"
,您将获得有用的信息。