ISO C 标准中 __attribute__
的替代品是什么?
我想移植独立于编译器的软件。
最佳答案
没有。
一种解决方案是抽象宏背后的属性。例如:
#ifdef __GNUC__
#define UNUSED __attribute((unused))__
#else
#define UNUSED
#endif
...
void function(void) UNUSED;
关于c - ISO C 标准中 __attribute__ 的替代品是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7498351/