方法一:编译器属性__attribute__
type varname __attribute__((unused))
//精简版
type varname __unused = ...
方法二:全局控制
方法三:#pragma unused()
type varname = ...
#pragma unused(varname)
方法四:
type varname = ...
(void)varname;
方法一:编译器属性__attribute__
type varname __attribute__((unused))
//精简版
type varname __unused = ...
方法二:全局控制
方法三:#pragma unused()
type varname = ...
#pragma unused(varname)
方法四:
type varname = ...
(void)varname;