home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: diamond@jit345.bad.jit.dec.com (Norman Diamond)
-
- In article <1e6nslINN4rd@ftp.UU.NET> rfg@netcom.com (Ronald F. Guilmette) writes:
- >Certain of the functions which must be declared (preferably with prototypes)
- >in the <stdio.h> file (e.g. vprintf) are defined (by the ANSI C standard) to
- >take arguments of type `va_list'.
-
- If a user's program declares printf instead of doing #include <stdio.h> then
- the user's program must include a prototype with ellipsis ", ...".
- If you're talking about the internals of the implementation's <stdio.h> then
- the implementation is allowed to encode the declarations however it likes,
- not necessarily encoded in the C language, not necessarily using prototypes
- -- the implementation can choose any method that works for itself.
-
- >But careful implementors know that if `va_list' is declared whever <stdio.h>
- >is included, this will cause an small but unnecessary (and possibly illegal)
- >pollution of the user's namespace.
- >My first question is simply this. Is the practice of avoiding definition
- >of a va_list type in <stdio.h> strictly required by the ANSI C standard?
-
- Yes. s/possibly// And carelessness yields non-conforming implementations.
-
- >In what other cases are such "hidden built-in type hacks" required as a result
- >of other requirements in the ANSI C standard (or in POSIX 1003.1-1990)?
-
- It's probably easiest to encode hidden built-in type hacks for EVERYTHING and
- avoid exactly this worry (assuming that you're an implementor).
-
- [Examples deleted: size_t in <time.h> and time_t in <sys/stat.h>]
-
- ANSI C section 4.12.1, page 171 line 12, says that <time.h> declares size_t.
- I don't have the POSIX standard.
-
- --
- Norman Diamond diamond@jit081.enet.dec.com
- If this were the company's opinion, I wouldn't be allowed to post it.
- "It's been a lovely recession."
-
- [ Note followup-to: line, please. Thanks -- mod ]
-
- Volume-Number: Volume 29, Number 73
-
-