Portablity using structures and malloc - Help
Arthur David Olson
ado at elsie.UUCP
Sat Jul 27 10:36:19 AEST 1985
In article <257 at bocklin.UUCP>, wendt at bocklin.UUCP writes:
> An easy way to determine alignment requirements is to take the size
> of a structure containing one character. Odd-length structures are
> invariably rounded up to convenient units by the compiler.
Or, preferably,
#define ALIGNMENT (sizeof (struct { char :1;}))
which avoids having to make up a name for a structure element.
--
UNIX is an AT&T Bell Laboratories trademark.
--
UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado at seismo.ARPA
DEC, VAX and Elsie are Digital Equipment and Borden trademarks
More information about the Comp.lang.c
mailing list