home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / std / c / 3026 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.6 KB  |  54 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!haven.umd.edu!decuac!pa.dec.com!datum.nyo.dec.com!nntpd.lkg.dec.com!jit345.bad.jit.dec.com!diamond
  3. From: diamond@jit345.bad.jit.dec.com (Norman Diamond)
  4. Subject: Re: Header files and "hidden built-in type hacks".
  5. Message-ID: <1992Nov17.004538.11235@nntpd.lkg.dec.com>
  6. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  7. Reply-To: diamond@jit.dec.com (Norman Diamond)
  8. Organization: Digital Equipment Corporation Japan , Tokyo
  9. References: <1e6nslINN4rd@ftp.UU.NET>
  10. Date: Tue, 17 Nov 1992 00:45:38 GMT
  11. Lines: 41
  12.  
  13. If anyone sees this article twice, please e-mail diamond@jit081.enet.dec.com.
  14. I removed it from comp.std.unix this time in hopes of seeing it get posted.
  15.  
  16. In article <1e6nslINN4rd@ftp.UU.NET> rfg@netcom.com (Ronald F. Guilmette) writes:
  17. >Certain of the functions which must be declared (preferably with prototypes)
  18. >in the <stdio.h> file (e.g. vprintf) are defined (by the ANSI C standard) to
  19. >take arguments of type `va_list'.
  20.  
  21. If a user's program declares printf instead of doing #include <stdio.h> then
  22. the user's program must include a prototype with ellipsis ", ...".
  23. If you're talking about the internals of the implementation's <stdio.h> then
  24. the implementation is allowed to encode the declarations however it likes,
  25. not necessarily encoded in the C language, not necessarily using prototypes
  26. -- the implementation can choose any method that works for itself.
  27.  
  28. >But careful implementors know that if `va_list' is declared whever <stdio.h>
  29. >is included, this will cause an small but unnecessary (and possibly illegal)
  30. >pollution of the user's namespace.
  31. >My first question is simply this.  Is the practice of avoiding definition
  32. >of a va_list type in <stdio.h> strictly required by the ANSI C standard?
  33.  
  34. Yes.  s/possibly//  And carelessness yields non-conforming implementations.
  35.  
  36. >In what other cases are such "hidden built-in type hacks" required as a result
  37. >of other requirements in the ANSI C standard (or in POSIX 1003.1-1990)?
  38.  
  39. It's probably easiest to encode hidden built-in type hacks for EVERYTHING and
  40. avoid exactly this worry (assuming that you're an implementor).
  41.  
  42. [Examples deleted:  size_t in <time.h> and time_t in <sys/stat.h>]
  43.  
  44. ANSI C section 4.12.1, page 171 line 12, says that <time.h> declares size_t.
  45. I don't have the POSIX standard.
  46.  
  47. >Volume-Number: Volume 29, Number 70
  48.  
  49. Is this an index to your encyclopedia of bugs in the ANSI C standard?
  50. --
  51. Norman Diamond       diamond@jit081.enet.dec.com
  52. If this were the company's opinion, I wouldn't be allowed to post it.
  53. "It's been a lovely recession."
  54.