From 3602315099999478579
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1149ec,f5b50f79e3b33c8d
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,c0143c56db298752
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-09-07 09:15:52 PST
Newsgroups: comp.std.c,comp.std.c++
Path: nntp.gmd.de!xlink.net!slsv6bt!slbh01.bln.sel.alcatel.de!rcvie!Austria.EU.net!EU.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: malloc calls FROM the standard library (was: Re: Question on 5.2.3.)
Message-ID: <Cvq7EC.HDo@twinsun.com>
Sender: usenet@twinsun.com
Nntp-Posting-Host: spot
Organization: Twin Sun Inc, El Segundo, CA, USA
References: <MHP1.94Sep1112739@Ra.msstate.edu> <1994Sep2.102654.14783@ida.liu.se> <CvIH4L.8G2@crdnns.crd.ge.com> <rfgCvpCJ4.I3F@netcom.com>
Date: Tue, 6 Sep 1994 20:54:10 GMT
Lines: 20
Xref: nntp.gmd.de comp.std.c:7759 comp.std.c++:8860

rfg@netcom.com (Ronald F. Guilmette) writes:

> It's my understanding that nothing provided by the implementation is
> supposed to call malloc.  (At least that is the rule in ANSI/ISO C,
> I believe.  I'm less sure about draft standard C++.)  In other words,
> user's should be able to replace `malloc' which their own routine of
> the same name.

No, `malloc' is reserved for use as an identifier with external linkage.
ANSI Classic 4.1.2.1 ``Reserved Identifiers'' says:

   * All identifiers with external linkage in any of the following sections
     (including the future library directions) are always reserved for use
     as identifiers with external linkage.

This means that a conforming library function can invoke `malloc' without
having to worry about whether a conforming program might redefine `malloc'.
The same thing goes for other Standard C functions, e.g. `remove';
it does not, however, go for functions that are not Standard C functions,
e.g. `unlink'.


