OK, thank you very much. I interpreted it wrongly. And I agree with Ross's suggestion like "This option has no effect unless -fstrict-aliasing is active".
One more question is why we won't make it "sufficient condition"? I think many newbies like me would not know about "strict-aliasing". But when we turn on -O2 options, the behavior after apply strict-aliasing may produce incorrect code. So if there is not any warnings, the incorrect behavior after applying strict-aliasing would lead to a misconception that GCC is buggy? Also, it would cost some time to debug and find the truth about "strict-aliasing". //I think I have learned a great lesson that I should always use -Wall options first to avoid implicitly turned on optimizations without warnings Best, Jim On Fri, Feb 13, 2009 at 6:53 PM, Paolo Bonzini <bonz...@gnu.org> 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? > > Paolo >