TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: All
from: Paul Edwards
date: 1996-11-25 00:26:00
subject: structure packing

Can someone tell me what the deal is with structure padding?

Does it apply to structures when they are DEFINED or when they are USED?

ie if I define a struct fred { char x; int y; }; and then do a #pragma
pack(1) (previously was pack(4)), and then declare a variable
x, ie struct fred x;, does x come out 5 or 8?

My experimentation with Watcom says that it is the *structure definition*
not the variable, that gets defined with the appropriate packing.

I was wondering whether this was universal?

Is it true that gcc under Linux has no compile-time option to pack
structures, same as EMX for OS/2?

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.