home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Standard library functions and macros
- Message-ID: <9300813.6316@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <1992Dec25.014646.9364@lucid.com> <1992Dec29.213548.5661@microsoft.com> <9300302.725@mulga.cs.mu.OZ.AU> <1993Jan04.224604.7304@microsoft.com>
- Date: Fri, 8 Jan 1993 02:40:03 GMT
- Lines: 45
-
- jimad@microsoft.com (Jim Adcock) writes:
-
- >fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >|I would be surprised if the changes did not require "real" external functions
- >|"shadowing" the inline definitions just as ANSI C required real functions
- >|to shadow macro definitions.
- >
- >It wouldn't be a conforming implementation if it provided both inline
- >and out-of-line implementation of a function. That would violate
- >the one-definition rule.
-
- This is not correct for several reasons. First, the implementation is
- *allowed* to violate the one-definition rule. (That rule constrains
- conforming programs, not conforming implementations.)
- Second, the inline definitions have internal linkage (which causes the silent
- change that you pointed out earlier) and thus are actually different functions
- to the out-of-line version in the library.
-
- [Attribution lost - I think this is Steve Clamage:]
- >|>|If Jim is saying that in a particular implementation the #undef has
- >|>|this effect and believes that effect should be preserved, then nothing
- >|>|stops an implementation from giving the #undef the same effect in C++,
- >|>|although I suspect he will have to lobby his vendors very hard to
- >|>|convince them to implement such a feature.
- [and this is Jim Adcock replying:]
- >|>If this is possible, then show me how to do it, because the solution
- >|>is not obvious to me.
-
- [My suggestion omitted]
-
- >Your "solution" does not implement the semantics called out in the ANSI-C
- >spec. [...]
-
- Yes. I was just showing how to preserve the effect of #undef, not all the
- other features. I don't see any major difficulty preserving virtually all
- the rest of the semantics, even down to (putchar)('x') being
- out-of-line, but as Steve Clamage stated, I suspect you will have to
- lobby your vendors very hard to convince them to implement such
- features.
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-