Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!rbutterworth From: rbutterworth@watmath.UUCP Newsgroups: comp.lang.c Subject: bytes don't fill words Message-ID: <4603@watmath.UUCP> Date: Fri, 23-Jan-87 08:20:13 EST Article-I.D.: watmath.4603 Posted: Fri Jan 23 08:20:13 1987 Date-Received: Sat, 24-Jan-87 04:39:59 EST Distribution: comp Organization: U of Waterloo, Ontario Lines: 19 If it doesn't do so already, the ANSI C standard should explicitly state the following: 1) BITS_PER_WORD%BITS_PER_BYTE need not necessarily be 0. 2) Given TypeA and TypeB, such that sizeof(TypeA) > sizeof(TypeB) and sizeof(TypeA) % sizeof(TypeB) is 0, then for union {TypeA a; TypeB b[sizeof(TypeA)/sizeof(TypeB)];} u; assigning values to all the individual members of array u.b will in some well-defined implementation-defined manner assign values to all the bits of u.a (but not necessarily of u itself). 3) The behaviour of functions memcmp(), memcpy(), etc. is undefined if the two arguments are not pointing at similarly aligned data. I realize that the last two are obvious given the first, but it took me a long time to realize that they were obvious and it would be nice if the standard explictly pointed them out.