Mail Archives: djgpp/1994/08/11/11:47:57
> According to Mike Castle:
> >
> > Amazingly enough Kimberley Burchett said:
> > >
> > >
> > > Is there any other way to pack a struct other than use __attribute__
> > > ((packed)) on every single one? I tried #defining PACK for a shortcut,
> >
> > #pragma pack
Hmmm... I think not. First, gcc docs says nothing of this #pragma (it
mentions several others, though). Second, the docs explicitly discourages
use of #pragmas. Third, searching inside cc1.exe for ``pack'' yields
nothing. It's true, if you try to compile a file with #pragma pack in
it, gcc won't complain, but it also doesn't complain if you put
#pragma xyzzy there. Seems, unknown pragmas are silently ignored.
I think, #pragma pack is from Borland C or Microsoft's. Anybody has
a definitive proof whether #pragma pack works under gcc?
Eli Zaretskii
- Raw text -