Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: The free() thing and function names Message-ID: <11084@smoke.BRL.MIL> Date: 16 Sep 89 23:57:21 GMT References: <1989Sep14.022055.5961@twwells.com> <841@uniol.UUCP> <1989Sep15.183248.2955@utzoo.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 24 In article <1989Sep15.183248.2955@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <841@uniol.UUCP> lehners@uniol.UUCP (Joerg Lehners) writes: >>What does the standard say about standardized function overriding ? >The answer is a little complicated. Assuming you just want to use a >standard function's name for your own purposes, you can always do this >provided (a) it doesn't begin with __ or _[A-Z], and (b) you do not >#include the standard header declaring that function. No, that's wrong. All identifiers in section 4 with external linkage (e.g. library function names) are reserved whether or not the associated header is included. It's only macros that are not reserved when the header is not included. See 4.1.2.1. >ANSI C essentially demands that scanf() not call atof() at all, ... No, in fact one of the main reasons the standard functions are reserved is so the implementation of other standard library routines may safely use them. What you were saying is true only of NON-standard library functions such as read(). "read" as an external identifier is reserved for the application's own use; the standard library implementation must not invoke the application's read() function (or data object!) in place of whatever it is expecting to use to read from files. Thus, POSIX implementations of Standard C will have library routines such as scanf() invoking __read() or some such reserved name instead.