home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
-
- In article <1e6nslINN4rd@ftp.UU.NET> rfg@netcom.com (Ronald F. Guilmette) writes:
- >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?
-
- Absolutely -- an implementation that defines the identifier "va_list" as
- a side effect of the inclusion of <stdio.h> does not conform to the C
- standard.
-
- >My second question is also a simple one. 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)?
-
- The most common issue is how to typedef e.g. size_t in multiple headers.
- This requires some sort of "one-time conditional lock", for example
- #ifndef __SIZE_T_DEFINED
- #define __SIZE_T_DEFINED
- typedef unsigned size_t;
- #endif
- in each header that is required to provide a declaration of size_t.
-
- >even though section 4.12.1 (describing <time.h>) does not seem to permit
- ><time.h> to define the size_t type.
-
- To the contrary, 4.21.1 specifies that size_t IS declared by <time.h>
- (X3.159-1989 p.171 l.12).
-
- >My second observation is that it appears that another such case arises
- >for those who wish to implement strict conformance with POSIX 1003.1-1990.
-
- I can't help much with that. Note that the POSIX.1 headers need to
- interoperate with the standard C headers, which implies more use of
- one-time conditional locks etc. Of course, the standard C headers
- exhibit some POSIX additions when included in the context of the
- _POSIX_SOURCE feature-flag macro. (This was necessitated to support
- existing UNIX practice -- it is NOT recommended that future standards
- specify more changes to the standard headers! For one thing, the
- parties responsible for the standard C+POSIX.1 implementation may not
- be the same parties as those who have to provide the additional
- implementation, for example a graphics library. And in any case
- the use of "feature flag" macros makes a mess of the headers that
- adds to maintenance woes.)
-
-
- Volume-Number: Volume 29, Number 74
-
-