Out of curiosity - I couldn't see it mentioned on your website - how much
emphasis does the Dinkum C99 Library place on purely standards-compliant
code? Obviously there are places where things must be tailored to an
implementation such as header files defining types, but otherwise does the
library ever have any specific code optimised for a particular platform
(whether that be standard or non-standard code), or is it completely
generic?
It's pretty generic, but we have to tailor in several ways:
-- stdarg.h and setjmp.h are *extremely* compiler specific. (In
many cases we simply defer to the ones supplied with the compiler,
but when we mess with these, we do so carefully.)
-- We determine the representation of various flexible types,
as you observe.
-- We determine the values of numeric limits, with special care
for twos-complement encodings.
-- We determine the various floating-point formats. We have a set
of about half a dozen math primitives that ensure a reasonable
tradeoff between portability, precision, and speed. They support
precisions from 24 bits to 113 bits, and exponent ranges from
2^128 to 2^16384, with all IEEE special cases.
-- We provide common nonstandard extensions to the C library,
either by replicating them or letting them "shine through".
--We determine the needed underlying system-call primitives
for I/O, program startup/shutdown, etc. These are very OS
specific.
-- We provide multithreading support, in both C and C++, which
also depends strongly on the underlying OS.
There are probably other things, but that's off the top of my
head.
And what sort of issues would prevent the library from being used with a
particular compiler?
See above.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com