Unused Arguments

If you enable the Unused Arguments setting, the compiler generates a warning 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.

void foo(int temp,int errer); // ERROR: errer is misspelled
{
error = do_something(); // WARNING: temp and error are
// unused.
}

You can declare an argument that you do not use in two ways without receiving this warning:

void foo(int temp, int error)
{
#pragma unused (temp)
/* Compiler does not warn that temp is not used */
error=do_something();
}

void foo(int /* temp */, int error)
{
/* Compiler does not warn that "temp" is not used.
error=do_something(); */
}

The Unused Arguments setting corresponds to the pragma warn_unusedarg, described at warn_unusedarg. To check this setting, use __option (warn_unusedarg).

See Checking Option Settings for information on how to use this directive.