Paolo Bonzini wrote:
"-Wstrict-aliasing
    This option is only active when -fstrict-aliasing is active. It
warns about code which might
break the strict aliasing rules that the compiler is using for
optimization. The warning does
not catch all cases, but does attempt to catch the more common
pitfalls. It is included in -Wall.
It is equivalent to -Wstrict-aliasing=3 "

and -O2 would active -fstrict-aliasing by default, which should also
active this options.

No, the text above means that "-fstrict-aliasing" is a *necessary*
condition to get aliasing warnings, not a sufficient condition.

Do you have suggestions for how to clarify the text?

Pergaps the first sentence should read something like "This option is only respected when -fstrict-aliasing is active", or "This option has no effect unless -fstrict-aliasing is active". I follow what the existing wording was intended to mean, but I can also see how it could easily be interpreted to mean that -fstrict-aliasing automatically implies -Wstrict-aliasing.

-- Ross Smith

Reply via email to