Datasheet
C and C++ Compilers
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-35
By default, unused declaration warnings are given for:
• local (within a function) declarations of variables, typedefs, and
functions
• labels (always within a function)
• top-level static functions and static variables.
-Wy
This option turns off warnings about deprecated features.
2.3.11 Specifying additional checks
The options described below give you control over the extent and rigor of the checks.
Additional checking is an aid to portability and is good coding practice.
-fa
This option checks for certain types of data flow anomalies. The compiler
performs data flow analysis as part of code generation. The checks
indicate when an automatic variable might have been used before being
assigned a value. The check is pessimistic and sometimes reports an
anomaly where there is none. In general, it is useful at some stage to
check all code using
-fa
.
-fh
This option checks that:
• all external objects are declared before use
• all file-scoped static objects are used
• all predeclarations of static functions are used between their
declaration and their definition. For example:
static int f(void);
static int f(void){return 1;}
line 2: Warning: unused earlier static declaration of 'f'
• external objects declared only in included header files are used in a
source file.
These checks directly support good modular programming practices.
When writing production software, use the
-fh
option only in the later
stages of program development. The extra diagnostics can be annoying in
the earlier stages.
-fp
This option reports on explicit casts of integers to pointers, for example:
char *cp = (char *) anInteger;
This warning indicates potential portability problems. Casting explicitly
between pointers and integers, although not clean, is not harmful on the
ARM processor where both are 32-bit types. This option also causes casts
to the same type to produce a warning. For example: