www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/11/11:47:57

To: bxkim AT camars DOT kaist DOT ac DOT kr (Kim Byung Ho)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: packed structs
Date: Thu, 11 Aug 94 15:23:45 +0300
From: eliz AT is DOT elta DOT co DOT il

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019