home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18823 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.5 KB  |  57 lines

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