Controls the recognition of unreferenced arguments.
#pragma warn_unusedarg on | off | reset
If you enable this pragma, the compiler issues a warning message when it encounters an argument you declare but do not use.
This check helps you find arguments that you either misspelled or did not use in your program. The listing below shows an example.
void func(int temp, int error);
{
error = do_something(); /* WARNING: temp is unused. */
}
To prevent this warning, you can declare an argument in a few ways:
void func(int temp, int error)
{
#pragma unused (temp)
/* Compiler does not warn that temp is not used. */
error=do_something();
}
The compiler allows this feature in C++ source code. To allow this feature in C source code, disable ANSI strict checking.
void func(int /* temp */, int error)
{
/* Compiler does not warn that "temp" is not used. */
error=do_something();
}
This pragma corresponds to the Unused Arguments setting in the C/C++ Warnings Panel . By default, this pragma is off .