如果我定义一个没有实际主体的函数宏,它是否像编译器的空字符串(即它在编译时不生成任何额外的指令)?
例:
#define SomeMacro(a)
SomeMacro("hello"); // This line doesn't add any instructions, does it?
没有定义的宏功能有什么用途/适用性:
#ifndef __SYSCALL
#define __SYSCALL(a, b)
#endif
可以在头文件中找到Linux系统中的这个宏 /usr/include/asm/msr.h
我也注意到以下类型的宏.
#define _M(x) x
并且只有定义这种宏的理由才能使代码统一.比如#define SOMETHING(1 << 0).是否还有其他隐藏(更好)的使用这种宏?
一个例子的答案将非常有帮助.也有人可以给我一个文本/链接来阅读这个.
我正在浏览一些gcc属性列表,我发现这个引起我注意的那个:
nothrow
The nothrow attribute is used to inform the compiler that a function cannot
throw an exception. For example, most functions in the standard C library can be
guaranteed not to throw an exception with the notable exceptions of qsort and
bsearch that take function pointer arguments. The nothrow attribute is not
implemented in GCC versions earlier than 3.3. 
C函数如何抛出异常?有人可以解释这个属性用于什么?
似乎有一个nothrow标签可用,但我发现那里似乎与C++有关std::nothrow.不确定这是否与我的特定问题有关.