Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!watmath!kpmartin From: kpmartin@watmath.UUCP (Kevin Martin) Newsgroups: net.lang.c Subject: what about alignment problems? Message-ID: <8318@watmath.UUCP> Date: Thu, 12-Jul-84 07:57:13 EDT Article-I.D.: watmath.8318 Posted: Thu Jul 12 07:57:13 1984 Date-Received: Fri, 13-Jul-84 02:56:13 EDT Organization: U of Waterloo, Ontario Lines: 14 After all, not everyone has ints, longs, and pointers all of the same size and alignment... There is currently no way in C to get the alignment required by a type. This makes writing a special-purpose storage allocator difficult. It also means that it is difficult to write a varargs function cleanly (since stepping though the args required aligning the pointer to the next boundary appropriate for the next type). Would it not be useful to have an 'alignof' operator, with the same usage as 'sizeof', but which returns the byte alignment required by the given type or expression? About the only reason against this is the 'yet *another* keyword' problem.