How do I align? help!

Stefan Axelsson d7stfax at dtek.chalmers.se
Tue Jul 17 07:34:05 AEST 1990


Hi, I'm currently writing a piece of software on a sun 3/80 later to be
ported to a sparcstation of some sort.  My humble question is how do I
assure correct alignment of structures containing almost every datatype in
C, stored in an area of memory returned by malloc?

I remember having read that the SPARCs are rather unforgiving when it
comes to alignment, and I don't want to go through the entire programme
again when I find that it won't port ( Yes, yes, I know that there's no
portable code, only code that's been ported.)

Is it enough to ensure that every malloced block is on a quad word
boundary, leaving the rest to the C compiler?  Answers on the back of a
postcard please ... :-)

Thanks in advance

Stefan Axelsson, d7stfax at dtek.chalmers.se

P.S. Oh I almost forgot, SUN OS 4.1 and gcc vs. 1.36 



More information about the Comp.sys.sun mailing list