🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52420

Packing structures in gcc

#52420
From: Graham Hausler
Date: Thu, 17 Sep 1992 08:08
20 lines
1613 bytes
I have a problem with gcc, and wonder if there is a quick solution to it...
I am developing communications on an m88k system to communicate with an m68k
system, using gcc, but am having trouble with default alignments within
structures....

The m68k likes to align on even addresses, but the m88k wants to align on
4-byte addresses, making the use of 'short's and 'char's within structures
dangerous.... (I know the RISC m88k loves 4-byte addresses/operations..)

Does gcc support 'packing' structures, ie only allocating the 'sizeof' the
element, and not attempting to align the next element on the next 4-byte
address (for the m88k). I would be happy if I could get it to use just 
even address alignment. I have tried using the __align__ attribute, but with
no effect ... I am using gcc-2.1

Please email any suggestions, thanks
Graham Hausler.

-- 
Internet:   hausler@aldetec.oz.au      --> GEMCO, Perth, Australia.
Technical Details
Message-ID: <514@aldetec.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!uniwa!aldetec!hausler

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,bfaed3fde75eb305,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1025b4,bfaed3fde75eb305,start
X-Google-Attributes: gid1025b4,public
X-Google-Thread: 106dae,bfaed3fde75eb305,start
X-Google-Attributes: gid106dae,public
X-Google-ArrivalTime: 1992-09-17 06:35:32 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!uniwa!aldetec!hausler
From: hausler@aldetec.oz.au (Graham Hausler)
Newsgroups: gnu.gcc.help,gnu.misc.discuss,comp.sys.m88k
Subject: Packing structures in gcc
Message-ID: <514@aldetec.oz.au>
Date: 17 Sep 92 08:08:32 GMT
Organization: Aldetec Pty Ltd, Perth West Australia
Lines: 21