我看到了那段代码 但不知道目的是什么。
void a() { static const char *string = "STRING"; ... (void)string; // <---- What the purpose of the line is? ... }
(void) 在这样的变量前会创建一个空的表达式,用来沉默程序没有使用变量的警告。
(void)
在这种特殊情况下,最好是简单地注释掉变量声明。