Mail Archives: djgpp/1996/05/09/03:44:27
On Thu, 9 May 96 03:15:00 UTC 0000 you said:
>
>P.S.: If you are using C++, the above will not work correctly due to a bug in
>gcc. To make it work, you have to surround your code with #pragma pack(1)
>and #pragma pack().
>
>John
Actually, the above will not even compile under G++. The docs say to append
__attribute__ ((packed)) to the end of every field, not the structure
declaration. However, your approach works with GNU C, though it is not
documented. GNU C++ does not accept it. I like your approach ( no extra
typing ) and I think G++ does not understand it due to a bug. I've reported
this to gcc bug list.
Martynas
- Raw text -