unused

Controls the suppression of warning messages for variables and parameters that are not referenced in a function.

Syntax
#pragma unused ( 
  var_name  [, 
  var_name  ]... )
  

var_name

The name of a variable.

Remarks

This pragma suppresses the compile time warning messages for the unused variables and parameters specified in its argument list. You can use this pragma only within a function body. The listed variables must be within the scope of the function.

In C++, you cannot use this pragma with functions defined within a class definition or with template functions.

Listing 1. Example of Pragma unused() in C
#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. */

}
Listing 2. Example of Pragma unused() in C++
#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 unused. */

}

This pragma does not correspond to any CodeWarrior IDE panel setting.

Related information
extended_errorcheck
maxerrorcount
message
showmessagenumber
show_error_filestack
suppress_warnings
sym
warning
warning_errors
warn_any_ptr_int_conv
warn_emptydecl
warn_extracomma
warn_filenamecaps
warn_filenamecaps_system
warn_hiddenlocals
warn_illpragma
warn_illtokenpasting
warn_illunionmembers
warn_impl_f2i_conv
warn_impl_i2f_conv
warn_impl_s2u_conv
warn_implicitconv
warn_largeargs
warn_missingreturn
warn_no_side_effect
warn_padding
warn_pch_portability
warn_possunwant
warn_ptr_int_conv
warn_resultnotused
warn_undefmacro
warn_uninitializedvar
warn_unusedarg
warn_unusedvar