__attribute__ ((noreturn))得使用

A few standard library functions, such as abort and exit, cannot return. GCC knows this automatically. Some programs define their own functions that never return. You can declare them noreturn to tell the compiler this fact. For example,


void fatal () __attribute__ ((noreturn));

;

翻译为:一些库函数,本身没有返回值,例如abort()和exit(),在编译的时候,GCC自动按照这个规则编译。而对于自己定义的函数,如果你不想让它有返回值,那么可以使用__attribute__ ((noreturn))

你可能感兴趣的:(框架学习)