defined but not used报错

在C程序中,如果定义了一个静态函数或变量,而没有去使用,编译时会有一个警告:'xxx' defined but not used

在函数或变量前添加如下:

__attribute__((unused))

可以告诉编译器忽略此告警:

转载说明:
1、https://blog.csdn.net/hanhui22/article/details/108869744

posted @ 2022-12-08 10:23  Rxin  阅读(2553)  评论(0)    收藏  举报