Mail Archives: djgpp/1997/04/08/12:29:11
On Mon, 7 Apr 1997, Mark T Logan wrote:
> I have a slight problem with the way that DJGPP packs its structs. ...
"Adrian Gh. Oboroc aka AsH / DEVOTiON" <oboroc AT usm DOT md> wrote:-
> You might want to use '#pragma pack' method:
>
> #pragma pack(1)
> struct Heroin ////// Lets keep this stuff out of it!!!!!!!
> {
> char dealer[100];
> int quality;
> double weight;
> }
> #pragma pack()
>
> but guys from FSF, who develops GCC, don't like pragmas, thus you'll get
> some warnings at compilation stage.
and thus you likely won't get any packing effect either. I put
#define pk __attribute__((packed))
at the start of my programs, so it is easy to put `pk' before every `;'
inside the struct {brackets}.
- Raw text -