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: <9300302.899@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <930101234006_76336.3114_EHJ42-1@CompuServe.COM>
- Date: Sat, 2 Jan 1993 15:34:04 GMT
- Lines: 41
-
- 76336.3114@CompuServe.COM (Kevin Dean) writes:
-
- >In an article date Dec. 31, Jim Adcock (jimad@microsoft.com) says:
- >
- >>"Reserved" in the same sense that ANSI-C reserved them -- that is if you
- >>#include the corresponding ANSI-C standard header, then the function
- >>names in that standard header become reserved.
- >
- >In what sense do they become reserved? I see no problem with reserving
- >::fcnName() but I have difficulty accepting the idea that Class::fcnName()
- >is reserved as well.
-
- They become reserved as an identifier. Class::fcnName() is reserved because
- fcnName() may be a macro. (Someone please correct me if my terminology is
- not quite correct here).
-
- >>If this is not acceptible, then simply don't include that standard header
- >>file.
- >
- >All well and good but I've seen some compilers (Microsoft's among them)
- >that, with certain optimizations turned on, reserve the function name
- >anyway even though its corresponding header has not been included. (I
- >don't know if this applies to MSC 7.0 since I haven't played with it yet
- >but it was certainly the case with 6.0).
-
- When the header file is not included, they are still reserved, but only
- as identifiers with external linkage. This means that Class::fcnName() is
- OK, as is
- static fcnName() { ... }
- or
- static int fcnName;
- but not any of the following:
- fcnName() { ... }
- extern fcnName() { ... }
- int fcnName;
-
- --
- 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!
-