Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Help me cast this! Message-ID: <7845@brl-smoke.ARPA> Date: 6 May 88 18:20:33 GMT References: <294@fedeva.UUCP> <7822@brl-smoke.ARPA> <3802@diku.dk> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <3802@diku.dk> njk@diku.dk (Niels J|rgen Kruse) writes: >... I gather that malloc has been redefined as void *malloc(). >Is a (void *) guaranteed to satisfy all alignment requirements? No. There are two distinct properties of the pointer returned by malloc(): one is that it is a "generic" pointer, capable of being safely converted to a pointer to any object type; the other is that it is guaranteed to be properly aligned so that this conversion is meaningful. These two properties are NOT the same and should not be bundled into a single language element. The "super-aligned" property is only true of pointers returned by malloc() and therefore didn't seem to need a specific notion in the C language. The "generic" property is essentially what ANSI C "void *" is intended for.