Path: utzoo!attcan!uunet!husc6!bloom-beacon!gatech!uflorida!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: malloc vs calloc and invalid pointers Message-ID: <8593@smoke.ARPA> Date: 3 Oct 88 03:31:30 GMT References: <13731@mimsy.UUCP> <827@goofy.megatest.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <827@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: >Now for the other question: Is it guaranteed that the actual memory >allocated (static, automatic, or malloc) for a variable foo is always >at least sizeof(foo)? No, under some circumstances an attempt to access some bytes of the virtual object "foo" might fail. For example, if "foo" is a structure with a hole at the end. > /* Might the following "step on" char a or char z? */ No, the objects are non-overlapping as a consequence of several constraints within the dpANS.