home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:18781 comp.std.c:3256
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!asuvax!chnews!sedona!bhoughto
- From: bhoughto@sedona.intel.com (Blair P. Houghton)
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: assert
- Followup-To: comp.std.c
- Date: 22 Dec 1992 16:39:37 GMT
- Organization: Intel Corp., Chandler, Arizona
- Lines: 44
- Message-ID: <1h7gc9INN8pf@chnews.intel.com>
- References: <HBF.92Dec19163113@gandalf.uio.no> <1992Dec21.163006.8068@taumet.com> <9212211543.PN29748@LL.MIT.EDU>
- NNTP-Posting-Host: stealth.intel.com
-
- Note the redirection.
-
- In article <9212211543.PN29748@LL.MIT.EDU> lebrun@ll.mit.edu (Steven F. LeBrun) writes:
- >I would think that standard header files
- >including other standard header files is almost a necessity in order that
- >standard header files may be include in any order and still keep the
- >standard header files as simple as practical.
-
- Headers are to be designed to be includable more than once,
- and in any order. This means that each one should be
- independent of the others, to the programmer. That is, you
- don't have to include stdio.h to use assert.h. It's not
- specified how this is accomplished, and presumably you
- could implement crossovers by including standard headers in
- other standard headers, but I don't see any places where
- it's absolutely necessary, if you use #ifndef carefully.
-
- But--and this is a big but--the identifier definitions in a
- standard header should be seen by the program if and only
- if the programmer explicitly includes that header.
- Otherwise the programmer should expect that they are not
- yet used.
-
- So if assert.h does need something from stdio.h, that
- something had better be in a namespace the user isn't
- allowed to use reliably (things starting with '_[A-Z]',
- for instance).
-
- The fifth bullet in section 4.1.2.1, Reserved Identifiers,
- gives the programmer leave to define things like `isalnum'
- and `offsetof' when ctype.h and stddef.h are not included
- explicitly.
-
- >If there is a section in the ANSI C standard that explicitly, or
- >implicitly, states that one standard header file can not include
- >another standard header file, I would like to know about it. Please,
- >email the section number.
-
- 4.1.2 and 4.1.2.1 don't say that, exactly, they just say
- that the implementation has to act as though it doesn't
- happen.
-
- --Blair
- "Or so it would seem."
-