home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / std / c / 2531 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  2.0 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!jit081.enet.dec.com!diamond
  2. From: diamond@jit081.enet.dec.com (28-Aug-1992 1244)
  3. Newsgroups: comp.std.c
  4. Subject: Re: <limits.h> and MB_LEN_MAX
  5. Message-ID: <9208280347.AA26586@enet-gw.pa.dec.com>
  6. Date: 28 Aug 92 03:47:31 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 29
  9.  
  10. In article <1992Aug27.165044.4781@ready.eng.ready.com> glenn@ready.com (Glenn Kasten) writes:
  11. ><limits.h> is supposed to define MB_LEN_MAX.  Is it permissible for a
  12. >conforming implementation to define MB_LEN_MAX in terms of another
  13. >type, where that other type is not declared in <limits.h>?  In other
  14. >words, do header files have to be complete in themselves, or can they
  15. >require other header files to also be included, in order to be usable?
  16.  
  17. Any program that has #include <limits.h> must get a definition of MB_LEN_MAX.
  18. If the implementation makes <limits.h> a file, and if that file causes
  19. inclusion of another file, and the result defines MB_LEN_MAX (and everything
  20. else that it has to define), and the result does not intrude on the
  21. application's namespace (e.g. not forcing a definition of stdin on a
  22. program that didn't #include <stdio.h>, and not forcing other stuff on a
  23. program), then there is no problem.
  24.  
  25. If it is possible to construct a valid program that has #include <limits.h>
  26. and uses MB_LEN_MAX but doesn't get correct behavior out of the
  27. implementation, then the implementation is not conforming.  If the
  28. implementation does something like nesting #include <stdio.h> and defines
  29. stuff that <limits.h> isn't supposed to, then it is not conforming.
  30.  
  31. As for what I mean by a "valid program," that essentially means that the
  32. program conforms to every possible conforming implementation.  It might not
  33. be strictly conforming because it might print out the value of MB_LEN_MAX,
  34. but it is still entitled to obtain correct behavior.
  35. --
  36. Norman Diamond       diamond@jit081.enet.dec.com
  37. If this were the company's opinion, I wouldn't be allowed to post it.
  38. "Yeah -- bad wiring.  That was probably it.  Very bad."
  39.