This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Additional GCC warnings?


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]