warn_unusedarg

Controls the recognition of unreferenced arguments.

Syntax
#pragma warn_unusedarg on | off | reset
Remarks

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.

Listing 1. Warning about unused function arguments
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();
}
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 .

Related information
extended_errorcheck
maxerrorcount
message
showmessagenumber
show_error_filestack
suppress_warnings
sym
unused
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_unusedvar