🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2522

alignment on sun386i with gcc

#2522
From: Marty
Date: Mon, 10 Apr 1989 22:46
30 lines
1191 bytes
I'm porting some code from Ms/Dos to a sun386i.  It talks to a TI34010
hanging on a board on the sun386i's AT bus.

I defined structures to represent message formats.

It seems I can't get the alignment I want without changing the code (i.e.
treating everything as an array of char and casting to short, long, etc at
the specific address desired).

Is there a simple way I can get the alignment I want here:
typedef struct {
        short  fd;
        long   buffer;
        short int       count;
} READ_MESSAGE;

where:

buffer is aligned 2 bytes after fd?

count is aligned 6 bytes after fd?

I didn't find anything about controlling object alignment at compile time.

marty
ARPA:	leisner.henr@xerox.com
GV:  leisner.henr
NS:  martin leisner:wbst139:xerox
UUCP:	hplabs!arisia!leisner
 
Technical Details
Message-ID: <890410-154628-5435@Xerox>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!XEROX.COM!Leisner.Henr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!XEROX.COM!Leisner.Henr
From: Leisner.Henr@XEROX.COM (Marty)
Newsgroups: gnu.gcc.bug
Subject: alignment on sun386i with gcc
Message-ID: <890410-154628-5435@Xerox>
Date: 10 Apr 89 22:46:18 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30