我在编译 C 源代码时收到以下警告gcc 4.6.1
。
warning: variable set but not used [-Wunused-but-set-variable]
我参考了这个链接Wunused但可以确切地知道是什么导致了这个警告。有人能更详细地告诉我是什么导致了这个警告吗?我们如何才能摆脱它?
[编辑] 我有以下代码片段。编译显示上述警告。你能建议我如何纠正它吗?
test_function(){
BOOL BoolTest;
BoolTest = test_fucntion2();
#ifdef CHECK
if (!BoolTest) {
misc_StartErrorReport();
misc_ErrorReport("\n test_function2: Input not indexed.\n");
misc_FinishErrorReport();
}
#endif
//
BoolTest is no more used below it.
// }