🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41399

Trouble with struct field alignment

#41399
From: Claudio Lanconelli
Date: Tue, 26 Mar 1996 00:00
14 lines
770 bytes
I use gcc for Linux-i486.
I don't want gcc align the struct fields to long word limits.
Which option have I to use??

i.e.
struct {
	char a;
	long b;		/* this should have offset 1, not 4! */
	short c;
	long d;
} v;

sizeof(v) == 16 !!!!!!
Technical Details
Message-ID: <Pine.SUN.3.91.960326121617.5507A-100000@gilda>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,f4b43fc7f5190a29,start
X-Google-Attributes: gid11318c,public
From: Claudio Lanconelli <lanconel@cs.unibo.it>
Subject: Trouble with struct field alignment
Date: 1996/03/26
Message-ID: <Pine.SUN.3.91.960326121617.5507A-100000@gilda>
X-Deja-AN: 144185382
organization: Department of Computer Science, University of Bologna, Italy
x-sender: lanconel@gilda
content-type: TEXT/PLAIN; charset=US-ASCII
mime-version: 1.0
newsgroups: gnu.gcc.help