This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Additional GCC warnings?
- From: Segher Boessenkool <segher at koffie dot nl>
- To: David Taylor <dtaylor at emc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 21 Mar 2003 16:23:38 +0100
- Subject: Re: Additional GCC warnings?
- References: <200303201932.h2KJVnI28318@mailhub.lss.emc.com>
David Taylor wrote:
-Waggregate-passed-by-value / -Wno-aggregate-passed-by-value
Warn if an aggregate parameter is passed by value rather than
by reference.
How is this useful?
-Wenum-mismatch / -Wno-enum-mismatch
Warn when value assigned to a variable of an enumeral type doesn't
correspond to an enumerator
This warns on the common construct
enum color { red, blue0, blue99 = blue0 + 99, green };
enum color col = blue0 + 37;
-Wprecision-mismatch / -Wno-precision-mismatch
Warn when the precision of the destination is smaller than
the precision of the source.
I like it.
-Winclude-depth-exceeds=<n>
Warn if the number of nested levels of #include'd files exceeds
<n>. Warning can be suppressed by #pragma include_depth_check_off
and re-enabled by #pragma include_depth_check_on.
How is this useful, except for detecting endless include loops
(which GCC already does)?
-Wpointer-cast-to-signed / -Wno-pointer-cast-to-signed
Warn about any casting of pointer type data to a signed entity
How is this useful?
Segher