home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18634 < prev    next >
Encoding:
Text File  |  1993-01-02  |  2.0 KB  |  53 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: <9300302.899@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <930101234006_76336.3114_EHJ42-1@CompuServe.COM>
  9. Date: Sat, 2 Jan 1993 15:34:04 GMT
  10. Lines: 41
  11.  
  12. 76336.3114@CompuServe.COM (Kevin Dean) writes:
  13.  
  14. >In an article date Dec. 31, Jim Adcock (jimad@microsoft.com) says:
  15. >
  16. >>"Reserved" in the same sense that ANSI-C reserved them -- that is if you
  17. >>#include the corresponding ANSI-C standard header, then the function
  18. >>names in that standard header become reserved. 
  19. >
  20. >In what sense do they become reserved?  I see no problem with reserving
  21. >::fcnName() but I have difficulty accepting the idea that Class::fcnName()
  22. >is reserved as well.
  23.  
  24. They become reserved as an identifier. Class::fcnName() is reserved because
  25. fcnName() may be a macro. (Someone please correct me if my terminology is
  26. not quite correct here).
  27.  
  28. >>If this is not acceptible, then simply don't include that standard header
  29. >>file.
  30. >
  31. >All well and good but I've seen some compilers (Microsoft's among them)
  32. >that, with certain optimizations turned on, reserve the function name
  33. >anyway even though its corresponding header has not been included.  (I
  34. >don't know if this applies to MSC 7.0 since I haven't played with it yet
  35. >but it was certainly the case with 6.0).
  36.  
  37. When the header file is not included, they are still reserved, but only
  38. as identifiers with external linkage. This means that Class::fcnName() is
  39. OK, as is
  40.     static fcnName() { ... }
  41. or
  42.     static int fcnName;
  43. but not any of the following:
  44.     fcnName() { ... }
  45.     extern fcnName() { ... }
  46.     int fcnName;
  47.  
  48. -- 
  49. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  50. This .signature virus is a self-referential statement that is true - but 
  51. you will only be able to consistently believe it if you copy it to your own
  52. .signature file!
  53.