Re: Data alignment problems with sizeof and new
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Tue, 1 Nov 2005 16:20:38 -0500
astdsoftware <astdsoftware@xxxxxxxxxxxxxxxx> wrote:
> I have a strange problem with a project involving classes with data
> alignment padding. It appears that, in this particular project, the
> sizeof and new operators are not taking the alignment padding into
> account when calculating the size of an object. The struct member
> alignment is set to 8 (/Zp8), and there are no #pragma pack
> directives.
Make sure /Zp8 is set on the whole project and not overridden on
individual files. It appears that different source files get compiled
with different packing. Check the build log to be sure this is not the
case.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- Data alignment problems with sizeof and new
- From: astdsoftware
- Data alignment problems with sizeof and new
- Prev by Date: Data alignment problems with sizeof and new
- Next by Date: Re: Character pointers?
- Previous by thread: Data alignment problems with sizeof and new
- Next by thread: Re: Data alignment problems with sizeof and new
- Index(es):