Mail Archives: djgpp/1996/10/07/01:12:39
Natasha and Don wrote:
> 
> John Panettiere wrote:
> >
> > Hello, all.
> >
> > ... realized that djgpp wasn't packing the data structures - so I browsed
> > the info files and found "__attribute__((packed))", which seemed to be
> > the answer I was looking for.
> 
> Hmm I suspect that your problem is that you are using C++,
> __attribute__ ((packed)) only seems to work for C. I have exactly
> the same problem myself and am thinking of using bitfields (barf)!
> 
> Does any one else have any ideas?
*sigh*.  If only more people would read the FAQ.  There is a bug in the
gcc compiler that makes it not pack structures correctly in C++.  You
have to surround the structure you want packed with #pragma pack(1) ...
#pragma pack().  The FAQ (v2/faq201b.zip) talks about this exact problem
in section 22.10.
Eli, DJ?  Is there a fixed version of gcc in v2.01?  A lot of people
would be curious to know.  :)
-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| Plan:  To find ANYONE willing to |   http://www.cs.com/fighteer   |
| play Descent 2 on DWANGO!        | Tagline: <this space for rent> |
---------------------------------------------------------------------
- Raw text -