Re: About strict-aliasing warning

2009-02-14 Thread ccg ijsj
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-ali

Re: About strict-aliasing warning

2009-02-13 Thread Ross Smith
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 pit

Re: About strict-aliasing warning

2009-02-13 Thread Paolo Bonzini
> "-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. I

About strict-aliasing warning

2009-02-13 Thread ccg ijsj
hi all, I wrote a simple testcase with some type prunned pointer and compiled it with -O2 option. I assumed that gcc would issue some warnings as told in its documents. But i am afraid that no warnings at all. I have to specify the -Wstrict-aliasing or -Wall option manually. Is this a docu