This is the mail archive of the gcc-help@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: bug with -O2 in g++ Debian 4.0.2-9 ?


Jerome Robert writes:
 >  Is this program wrong

Yes.

See ISO C9899:199 Section 6.3.2.3.  

These lines are particularly bogus:

    void ** aa=(void **)(void *)&a;
    void ** ab=(void **)(void *)&b;

All the cast to (void *) does is suppress a useful warning.

-fno-strict-aliasing may help.

Andrew.


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