2012年4月26日 星期四

defined but not used


Just saw this thread while searching for solutions to this problem. I post here for completeness the solution I found...
The GCC compiler flags that control unused warnings are
-Wunused-function-Wunused-label-Wunused-parameter-Wunused-value-Wunused (=all of the above)
Each of these has a corresponding negative form with "no-" inserted after the W which turns off the warning (in case it was turned on by -Wall, for example). Thus, in your case you should use
-Wno-unused-function
Of course this works for the whole code, not just compile-time asserts. For function-specific behaviour, have a look at Function attributes.

沒有留言:

張貼留言