3

我正在学习"include/asm-x86/types.h",我对 的含义有点困惑\__signed__

当我谷歌这个关键字时,我无法获得任何有用的信息。为什么不直接使用signed而不是\__signed__,它有什么特殊含义吗?

4

3 回答 3

1

这用于向后兼容,当较旧的编译器无法识别signed关键字时,会使用此类替代方案。

于 2013-08-13T10:35:48.687 回答
1

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
*/
于 2013-08-13T10:36:59.710 回答
1

__signed__也用于 compile with gcc -traditional,其中关键字signed无法识别。

不要使用 google c __signed__,因为在搜索中会跳过特殊字符,例如__使用 进行文字搜索c "__signed__",您将获得有用的信息。

于 2013-08-13T10:38:15.740 回答