warn_undefmacro. NXP CodeWarrior Development Studio
Mainos
Mainos
warn_undefmacro
#pragma warn_resultnotused on | off | reset
Remarks
If you enable this pragma, the compiler issues a warning message when it encounters a statement that calls a function without using its result. To prevent this, cast the statement with
(void)
.
Listing 31-23 on page 498 provides an example.
Listing 31-23. Example of Function Calls with Unused Results
#pragma warn_resultnotused on extern int bar(); void func()
{
bar(); /* WARNING: result of function call is not used. */
void(bar()); /* OK: void cast suppresses warning. */
}
This pragma does not correspond to any panel setting. By default, this pragma is off.
31.32 warn_undefmacro
Controls the detection of undefined macros in
#if
and
#elif
directives.
Syntax
#pragma warn_undefmacro on | off | reset
Remarks
Listing 31-24 on page 498 provides an example.
Listing 31-24. Example of Undefined Macro
#if BADMACRO == 4 /* WARNING: undefined macro. */
Use this pragma to detect the use of undefined macros (especially expressions) where the default value 0 is used. To suppress this warning message, check if defined first.
NOTE
A warning message is only issued when a macro is evaluated. A short-circuited "
&&
" or "
||
" test or unevaluated "
?:
" will not produce a warning message.
By default, this pragma is off
.
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
498 Freescale Semiconductor, Inc.
Lataa
Mainos