Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Alignment of malloced memory (was: lint on malloc calls) Keywords: lint, malloc, alignment Message-ID: <8522@smoke.ARPA> Date: 17 Sep 88 21:34:44 GMT References: <39617@linus.UUCP> <9900007@bradley> <216@iaoobelix.UUCP> <7592@haddock.ima.isc.com> <256@itivax.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <256@itivax.UUCP> scs@itivax.UUCP (Steve C. Simmons) writes: >All the discussion on the alignment of memory allocated by malloc >is interesting, but only serves to point up that no matter what >we try, the following lines of code are potentially non-portable: >... >char *foo2 = malloc( foo2 ) ; >... "Incomprehensible" might be a better description. What are you trying to say/ask? malloc() most certainly can be used portably: /* (declarations omitted) */ obj_ptr = (obj *)malloc( how_many * sizeof(obj) );