This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to disable warning for an unused function?

I strive to always compile with no errors and no warnings. One file has some test functions that are only used when built in test mode. Is there an existing macro to suppress warnings for these kinds of test functions? Like an equivalent to how to you can indicate to the compiler to disregard the fact that I don't need to use an input parameter, but am forced to accept one, like we sometimes do for timer expiration callbacks when using the app_timer module:

void on_my_timer_expired(void * p_context) {
  UNUSED_PARAMETER(p_context);
  // Do something
}
Parents Reply Children
Related