Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!guy%gorodish@Sun.COM From: guy%gorodish@Sun.COM Newsgroups: comp.lang.c Subject: Re: Byte vs. Word Alignment - (nf) Message-ID: <7020@brl-adm.ARPA> Date: Tue, 21-Apr-87 11:02:14 EST Article-I.D.: brl-adm.7020 Posted: Tue Apr 21 11:02:14 1987 Date-Received: Wed, 22-Apr-87 03:21:06 EST Sender: news@brl-adm.ARPA Lines: 15 > Byte vs. word alignment is a problem I have encountered recently when I > tried to setup a simple server/client connection using sockets. Yup - and I know of another machine whose padding rules are different from both VAX and Sun (CCI 6/32 - last time I looked, which admittedly was a while ago, it aligned structures at least on 4-byte boundaries, as opposed the VAX PCC which aligns them to the boundary of the most strictly aligned member and the Sun PCC which aligns them to the more restrictive of "most strictly aligned member" and "2 bytes"). The moral of the story is "don't send raw structures over the wire if you can possibly avoid it" (note that you couldn't have sent *raw* structures over the wire anyway unless you had the receiving program fix the byte order, if necessary).