我有一个trace()
宏,我用另一个宏打开和关闭,例如
#ifdef TRACE
#define trace(x) trace_val(x, 0)
#else
#define trace(x) 0
#endif
当我使用undefinedwarning: statement with no effect
调用时,这会从 gcc生成。经过一番搜索,我发现改变了trace()
TRACE
#define trace(x) 0
到
#define trace(x) (void)0
使错误静音。我的问题是:为什么?有什么不同?