The free() thing and function names

Larry Jones scjones at sdrc.UUCP
Sun Sep 17 06:25:37 AEST 1989


In article <1989Sep15.183248.2955 at utzoo.uucp>, henry at utzoo.uucp (Henry Spencer) writes:
> In article <841 at uniol.UUCP> lehners at 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.  If either of these
> restrictions is violated, behavior is "undefined", i.e. it's up to your 
> compiler and it's not portable.

That's true provided that you do not use it for an external
variable or function.  The names of library routines are reserved
in the external name space and may not be redefined reguardless
of whether you #include the associated header.

> ANSI C
> essentially demands that scanf() not call atof() at all, but some internal
> version with a name in the implementation-reserved name space (see clause
> (a) above).

Nope, standard library routines are at liberty to call other
standard library routines at will.  What they may NOT do is call
anything OTHER than a standard library routine unless it has a
reserved name as in (a) above.
----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at SDRC.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150-2789             AT&T: (513) 576-2070
"I have plenty of good sense.  I just choose to ignore it."
-Calvin



More information about the Comp.lang.c mailing list