This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Updated glibc header namespace / C standards comparison
- To: libc-alpha at sources dot redhat dot com
- Subject: Updated glibc header namespace / C standards comparison
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Wed, 13 Sep 2000 12:29:54 +0100 (BST)
Here is an updated namespace comparison of the glibc headers against
the C standards. This one does not include the details now in
CONFORMANCE.
The URL for this message in the libc-alpha archives should probably
replace the URLs of the older version of this comparison at the bottom
of CONFORMANCE.
The appearance of clockid_t and timer_t in <time.h> is new since the
previous version of this comparison.
I compared the glibc headers against the 1990/1994/1999 C standards.
The following were the discrepancies I found.
All tests were done with recent glibc and GCC CVS, the headers being
preprocessed with -std=c89 / -std=iso9899:199409 / -std=c99 with and
without -O2, and with no feature test macros defined, on i686-linux.
complex.h
=========
Some inline functions use ~ for complex conjugation; as this is a C99
constraint violation (6.5.3.3p1), __extension__ should probably be
used here.
ctype.h
=======
This header should not declare size_t (which gets declared via
<bits/types.h>). (POSIX.1 generally reserves the _t suffix, but pure
ISO C does not.)
inttypes.h
==========
This header should not declare the type wchar_t.
The values of WCHAR_MIN and WINT_MAX are wrong. See 7.18.3p4 and
footnote 219. The values are the limits of the integer types involved
and need not be valid as wide characters. (AMD1 may be clearer than
C99 on the meaning of WCHAR_MIN, there in <wchar.h>.)
signal.h
========
Should not declare size_t.
stdint.h
========
Only problems (declaration of wchar_t, wrong types and values of
macros) listed above under inttypes.h.
stdio.h
=======
Should not declare or use wchar_t, wint_t or off_t.
tgmath.h
========
See complex.h above.
time.h
======
CLOCKS_PER_SEC should be of type clock_t for C99 - on x86 Linux, this
is `long int' rather than the present `int' type of CLOCKS_PER_SEC.
Should not declare clockid_t or timer_t.
wchar.h
=======
See stdint.h above for wrong value of WCHAR_MIN.
This header should not declare FILE.
The following functions are in AMD1 and should be declared by this
header when __STDC_VERSION__ >= 199409L, not just for C99: fwprintf,
fwscanf, wprintf, wscanf, swprintf, swscanf, vfwprintf, vwprintf,
vswprintf, fwide.
wctype.h
========
This header should not declare size_t.
--
Joseph S. Myers
jsm28@cam.ac.uk