Microchip Technology SW006023-3N Datenbogen

Seite von 238
MPLAB
®
 XC32 C/C++ Compiler User’s Guide
DS51686E-page 68
 2012 Microchip Technology Inc.
The following -W options are not implied by -Wall. Some of them warn about 
constructions that users generally do not consider questionable, but which you might 
occasionally wish to check for. Others warn about constructions that are necessary or 
hard to avoid in some cases, and there is no simple way to modify the code to suppress 
the warning.
-Wuninitialized
Warn if an automatic variable is used without first being 
initialized. 
These warnings are possible only when optimization is enabled, 
because they require data flow information that is computed only 
when optimizing.
These warnings occur only for variables that are candidates for 
register allocation. Therefore, they do not occur for a variable 
that is declared volatile, or whose address is taken, or whose 
size is other than 1, 2, 4 or 8 bytes. Also, they do not occur for 
structures, unions or arrays, even when they are in registers.
Note that there may be no warning about a variable that is used 
only to compute a value that itself is never used, because such 
computations may be deleted by data flow analysis before the 
warnings are printed.
-Wunknown-pragmas
Warn when a #pragma directive is encountered which is not 
understood by the compiler. If this command line option is used, 
warnings will even be issued for unknown pragmas in system 
header files. This is not the case if the warnings were only 
enabled by the -Wall command line option.
-Wunused
Warn whenever a variable is unused aside from its declaration, 
whenever a function is declared static but never defined, 
whenever a label is declared but not used, and whenever a 
statement computes a result that is explicitly not used.
In order to get a warning about an unused function parameter, 
both -W and -Wunused must be specified.
Casting an expression to void suppresses this warning for an 
expression. Similarly, the unused attribute suppresses this 
warning for unused variables, parameters and labels.
-Wunused-function
Warn whenever a static function is declared but not defined or a 
non-inline static function is unused.
-Wunused-label
Warn whenever a label is declared but not used. To suppress 
this warning, use the unused attribute. 
-Wunused-parameter
Warn whenever a function parameter is unused aside from its 
declaration. To suppress this warning, use the unused attribute.
-Wunused-variable
Warn whenever a local variable or non-constant static variable is 
unused aside from its declaration. To suppress this warning, use 
the unused attribute.
-Wunused-value
Warn whenever a statement computes a result that is explicitly 
not used. To suppress this warning, cast the expression to void. 
TABLE 3-8:
WARNING AND ERROR OPTIONS IMPLIED BY ALL WARNINGS 
Option
Definition