Can an implementation ``pre-qualify'' a standard type?

Paul Eggert eggert at twinsun.com
Tue Jun 11 09:21:44 AEST 1991


Can a conforming Standard C implementation header ``pre-qualify'' a
standard type by ``hardwiring'' a qualifier into its typedef?  E.g. can
<signal.h> behave as if

	typedef volatile int sig_atomic_t;

defines sig_atomic_t?  Rumor has it that at least one would-be
conforming implementation does this to head off common programming errors.

If you answered ``yes'' to the above question, where does this sort of
thing stop, and why?  Is `volatile' permitted but `const' forbidden here?
For example, can <stdio.h> behave as if

	typedef const struct {/*...etc...*/} FILE;

defines FILE?  Can <time.h> behave as if

	struct tm { const int inconvenient; int tm_sec; /*...etc...*/};

defines struct tm?  Can <stddef.h> behave as if

	typedef const unsigned size_t;

defines size_t?



More information about the Comp.std.c mailing list