Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site elsie.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.unix,net.lang.c Subject: Re: Portablity using structures and malloc - Help Message-ID: <5181@elsie.UUCP> Date: Fri, 26-Jul-85 20:36:19 EDT Article-I.D.: elsie.5181 Posted: Fri Jul 26 20:36:19 1985 Date-Received: Sun, 28-Jul-85 06:34:06 EDT References: <81@drux1.UUCP> <907@umcp-cs.UUCP> <4772@allegra.UUCP> <257@bocklin.UUCP> Organization: NIH-LEC, Bethesda, MD Lines: 13 Xref: linus net.unix:4561 net.lang.c:5269 Summary: bit field vs. char In article <257@bocklin.UUCP>, wendt@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@seismo.ARPA DEC, VAX and Elsie are Digital Equipment and Borden trademarks