Controls the suppression of warnings for variables and parameters that are not referenced in a function.
#pragma unused ( var_name [, var_name ]... )
This pragma suppresses the compile time warnings for the unused variables and parameters specified in its argument list as shown in Listing 10.32 and Listing 10.33. You can use this pragma only within a function body, and the listed variables must be within the scope of the function. You cannot use this pragma with functions defined within a class definition or with template functions.
#pragma warn_unusedvar on
#pragma warn_unusedarg on
static void ff(int a)
{
int b;
#pragma unused(a,b) // Compiler does not warn
// that a and b are unused
// . . .
}
#pragma warn_unusedvar on
#pragma warn_unusedarg on
static void ff(int /* No warning */)
{
int b;
#pragma unused(b) // Compiler does not warn that b is not used.
// . . .
}
This pragma does not correspond to any panel setting.