Devang wrote:
But why it works with debug version and not with release version.
The debug code is pretty much a translation of the source code to some load
and store instructions. For the release code, the compiler analyses the
sourcecode in order to perform optimisations on it. These optimisations
rely stronger on the sourcecode being valid, e.g. they might assume that
the pointer was suitably aligned and also that no aliasing rules are
broken. If these assumptions don't hold, the optimiser can fail; sometimes
it can still emit a warning, sometimes it can't.
Uli
--
C++ FAQ:http://parashift.com/c++-faq-lite
Sator Laser GmbH
Gesch?ftsf?hrer: Thorsten F?cking, Amtsgericht Hamburg HR B62 932
I tried to set Struct alignment to 8 byte.