*BSD News Article 81841


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!EU.net!main.Germany.EU.net!Dortmund.Germany.EU.net!interface-business.de!usenet
From: j@ida.interface-business.de (J Wunsch)
Newsgroups: comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc,comp.unix.misc,comp.unix.questions,comp.infosystems.www.servers.unix
Subject: Re: mod_counter & gd1.2
Date: 30 Oct 1996 10:04:22 GMT
Organization: interface business GmbH, Dresden
Lines: 25
Message-ID: <557976$68o@innocence.interface-business.de>
References: <327636B0.68EE@greenwood.net> <327654B1.1390@arlut.utexas.edu>
Reply-To: joerg_wunsch@interface-business.de (Joerg Wunsch)
NNTP-Posting-Host: ida.interface-business.de
X-Newsreader: knews 0.9.6
X-Phone: +49-351-31809-14
X-Fax: +49-351-3361187
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:5200 comp.unix.bsd.misc:1417 comp.unix.misc:25887 comp.unix.questions:90137 comp.infosystems.www.servers.unix:21209

Ian Fink <fink@arlut.utexas.edu> wrote:

> In the file gd.c comment out the line:  #include <malloc.h>

No application should include <malloc.h>, it's pre-ANSI.  Use
<stdlib.h> if you wanna get prototypes for malloc(), free() etc.

I assume BSD/OS links <malloc.h> to <sys/malloc.h>.  Of course, the
latter describes the _kernel_ memory allocator, and is thus probably
not what the program did really want.

Having /usr/include/malloc.h sometimes proves useful for quick'n dirty
porting 3rd party software, though.  That's why FreeBSD's file looks
like:

#if __GNUC__
#warning "this file includes <malloc.h> which is obsoleted, use <stdlib.h> instead"
#endif

#include <stdlib.h>

-- 
J"org Wunsch					       Unix support engineer
joerg_wunsch@interface-business.de       http://www.interface-business.de/~j