Message from discussion
malloc
Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!24.30.200.11!news-east.rr.com!news-feed-01.rdc-kc.rr.com!news.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!tornado.socal.rr.com.POSTED!53ab2750!not-for-mail
Newsgroups: comp.lang.c
Subject: Re: malloc
References: <1165899429.205971.52070@80g2000cwy.googlegroups.com> <elm6r2$add$1@ss408.t-com.hr>
<GpWdnQIRluLNOePYRVnyigA@bt.com> <elm94a$gc6$1@ss408.t-com.hr>
<7KOdnVNe_ry6LePYRVnyigA@bt.com> <elmk3g$g50$1@ss408.t-com.hr>
<elmkm7$5u7$1@murdoch.hpl.hp.com>
From: Keith Thompson <ks...@mib.org>
Message-ID: <lnfybkenqv.fsf@nuthaus.mib.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)
Cancel-Lock: sha1:wTAEw7WGNLihRqsfgwwOPgv+gk0=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 21
Date: Tue, 12 Dec 2006 22:46:32 GMT
NNTP-Posting-Host: 75.80.183.54
X-Complaints-To: abuse@rr.com
X-Trace: tornado.socal.rr.com 1165963592 75.80.183.54 (Tue, 12 Dec 2006 14:46:32 PST)
NNTP-Posting-Date: Tue, 12 Dec 2006 14:46:32 PST
Organization: Road Runner High Speed Online http://www.rr.com
Chris Dollin <chris.dol...@hp.com> writes:
> Sourcerer wrote:
>> True, but I assumed the author omitted the inclusion of the header
>> for the sake of brevity.
>
> Sadly, this isn't a safe assumption. So we assume that what isn't presented,
> isn't there.
Indeed. We see plenty of code that calls library functions without
including the required header. In many cases, the poster omitted the
#include out of ignorance, not for brevity.
Unfortunately, such code happens to "work" under many implementations,
so the compiler might not sufficiently encourage the user to break his
bad habits. (Most compilers will probably issue a warning; too many
programmers silence the warning by adding a cast.)
--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.