This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C9x conformance check



I did a check of conformance to the draft standard in the headers provided
by gcc and glibc.  Take the results with a grain of salt;  there may be
problems with the checker, also I have only the April draft and egcs-1.0.3.
I wasn't able to check typedefs or struct definitions.

Problems which are gcc's fault:

egcs 1.0.3/x86 #defines i386 and i486 even if -undef is given.  (I dimly
remember this was to work around problems with Imake?)

limits.h does not define LLONG_MIN, LLONG_MAX, or ULLONG_MAX.

stdarg.h does not define va_copy.

-aux-info has a bug: if you do
  typedef struct TAG { ... } NAME;
  int foo (NAME x);
then -aux-info reports
  int foo (TAG x);

Problems which are libc's fault:

ctype.h: isblank() is under _GNU_SOURCE not _ISOC9X_SOURCE.

math.h:  isinf() should be a macro; furthermore, it's hiding under
__USE_MISC.
scalb(), scalbl(), scalbf() should be under _BSD_SOURCE; C9x only has
scalbn().
C9x specifies gamma(); libc only has tgamma().

signal.h: unconditionally prototypes pthreads functions due to
bits/sigmask.h.

stdio.h: stdin, stdout, stderr are supposed to be macros.
vscanf, vfscanf, vsscanf are under _GNU_SOURCE not _ISOC9X_SOURCE.
fgetpos, fsetpos are only provided if _LARGEFILE_SOURCE is defined.
(Weren't these in C89?)

stdlib.h: strtof, strtold are under _GNU_SOURCE not _ISOC9X_SOURCE.

time.h: zonetime() is not implemented.

wchar.h: The wide I/O functions and wcsftime/wcsfxtime are not implemented.

wctype.h: iswblank() is under _GNU_SOURCE not _ISOC9X_SOURCE.

complex.h: The CX_LIMITED_RANGE macros are nowhere in my copy of the
standard.

inttypes.h: #defines intptr_t (for coordination with unistd.h; this should
be __intptr_t_defined).
PRIiMAX, PRIXMAX, PRIiPTR, PRIXPTR, and most of the SCN* macros are missing.

tgmath.h: the fma() macro is missing.

Problems due to interaction effects or where either party can be blamed:

FLT_EVAL_METHOD is in math.h; it belongs in float.h.

stdbool.h does not exist.  This header is trivial but we should agree on who
provides it.

complex.h #defines `complex'.  (This is arguably fine.)

stdarg.h provides stdio.h with an internal name for va_list: __gnuc_va_list. 
Other compilers can't be expected to know that.  __va_list is perhaps more
reasonable?
Also, stdarg.h prototypes va_end (as well as #defining it) which is ok
except that it assumes va_end() exists in the library, which it doesn't.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]