Re: Ported to 2005 - Strange variable alignment causing issues
- From: "Tursi" <msdnlion@xxxxxxxxxx>
- Date: Wed, 14 Jun 2006 22:05:37 -0700
Doug and Carl - thanks for the additional suggestions. I finally managed to
track it down.
While I'm not using precompiled headers, Carl's suggestion that I had to be
defining the object differently in different places made sense. I couldn't
find any duplicate includes or anything like that, so I extended Doug's
suggestion of multiple #pragma pack(show)'s, and I finally found one that
was messing things up.
A library I bought years ago was issuing #pragma pack(push, 1), followed
later by #pragma pack(pop, 1). Only one of the two files that accessed this
class was including that header, and I suspect that the author did not
realize that this left the pack value at 1, rather than pushing and popping
the original version. I've NO idea why this didn't blow up on VC6. :)
Exactly why it would compile the source file that did NOT include that
header differently at different times I'm not sure - perhaps an optimization
that the compiler remembers the class layout from the first time it saw the
object included? (Temporary precompiled headers?)
Thank you everyone for your helpful suggestions. I spent a lot of time
tracking this down and I feel much better to find it's in MY code and not
the compiler! :)
.
- References:
- Ported to 2005 - Strange variable alignment causing issues
- From: Tursi
- Re: Ported to 2005 - Strange variable alignment causing issues
- From: Tursi
- Re: Ported to 2005 - Strange variable alignment causing issues
- From: Tursi
- Re: Ported to 2005 - Strange variable alignment causing issues
- From: Carl Daniel [VC++ MVP]
- Ported to 2005 - Strange variable alignment causing issues
- Prev by Date: beginner: assertion error on class export from dll
- Next by Date: Re: [ANN] Currently available hotfixes for VC 2005
- Previous by thread: Re: Ported to 2005 - Strange variable alignment causing issues
- Next by thread: transmission control protocol connection
- Index(es):
Relevant Pages
|