魔鬼的惊叹 发表于 2014-11-27 10:44

内核初始化过程中的各种看不懂的c语法

比如__attribute__, section,等等。这些内容是gcc的对c语言提供的扩展吗?很想知道这块可以在哪找到相应的手册。

yangPSO 发表于 2014-11-27 12:06

《Using the GNU Compiler Collection (GCC)》
第5章 Extensions to the C Language Family

比如:
section ("section-name")
Normally, the compiler places the code it generates in the text section. Sometimes,
however, you need additional sections, or you need certain particular
functions to appear in special sections. The section attribute specifies that a
function lives in a particular section. For example, the declaration:
extern void foobar (void) __attribute__ ((section ("bar")));

Tinnal 发表于 2014-11-27 20:28

回复 1# 魔鬼的惊叹


    https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/
页: [1]
查看完整版本: 内核初始化过程中的各种看不懂的c语法