What is the best/neatest way to suppress a compiler (in this case gcc) like "Unused variable x"-warning?
I don't want to give any certain flags to gcc to remove all these warnings, just for special cases.
Found an article http://sourcefrog.net/weblog/software/languages/C/unused.html that explains UNUSED. Interesting that the author also mangles the unused variable name so you can't inadvertently use it in the future.
#ifdef UNUSED #elif defined(__GNUC__) # define UNUSED(x) UNUSED_ ## x __attribute__((unused)) #elif defined(__LCLINT__) # define UNUSED(x) /*@unused@*/ x #else # define UNUSED(x) x #endif void dcc_mon_siginfo_handler(int UNUSED(whatsig))