C C++ 去除 unused的提示

#define UNUSED(VAR) {VAR++;VAR--;}

unsigned int user_id=0;
UNUSED(user_id);

 

这样就可以在C、C++编译器 编译源文件的时候 取消 未使用的变量的提示了。

 

 

 

更好的办法是:

#define UNUSED(A) (void*)(a);

 

这算什么呢? 强制转换 还是 空函数调用?

 

相关文章:

  • 2021-10-19
  • 2021-06-27
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2023-02-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-05-19
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案