d7stfax@dtek.chalmers.se (Stefan Axelsson) (07/17/90)
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@dtek.chalmers.se P.S. Oh I almost forgot, SUN OS 4.1 and gcc vs. 1.36