home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18781 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.3 KB

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