🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42029

DWord alignment of structs

#42029
From: Jan Eric Hoffmann
Date: Tue, 16 Jan 1996 00:00
13 lines
723 bytes
I created a struct like this:

struct {
  short int a;
  long int b;
 } XX;

Using the sizeof operator tells me that that the size of this struct
is 8 bytes. I'm parsing a binary file, I need a 6byte struct!
Is there a command line switch to turn of Dword alignment?

Jan Eric Hoffmann
hoffmann@math.uni-hamburg.de
Technical Details
Message-ID: <4dg5l7$55s@rzsun02.rrz.uni-hamburg.de>
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,8d820a5a7679bef4,start
X-Google-Attributes: gid11318c,public
From: am6a002@GEOMAT.math.uni-hamburg.de (Jan Eric Hoffmann)
Subject: DWord alignment of structs
Date: 1996/01/16
Message-ID: <4dg5l7$55s@rzsun02.rrz.uni-hamburg.de>
X-Deja-AN: 135481190
organization: University of Hamburg -- Germany
newsgroups: gnu.gcc.help