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