unused. NXP CodeWarrior Development Studio
Werbung
Werbung
Chapter 31 Pragmas for Diagnostic Messages
The compiler pays attention to this pragma only if you enable the debug marker for a file in the IDE project window. If you disable this pragma, the compiler does not put debugging information into the source file debugger symbol file (SYM or DWARF) for the functions that follow.
The compiler always generates a debugger symbol file for a source file that has a debug diamond next to it in the IDE project window. This pragma changes only which functions have information in that symbol file.
This pragma does not correspond to any panel setting. By default, this pragma is enabled.
31.8 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 31-5. 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 31-6. Example of Pragma unused() in C++
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
471
Herunterladen
Werbung