> From: Russ Allbery <[EMAIL PROTECTED]>
> Date: 28 May 2001 11:05:08 -0700
> 
> Lars Hecking <[EMAIL PROTECTED]> writes:
> 
> >  What's the rationale behind using inttypes.h, and not stdint.h?
> 
> inttypes.h is more widespread on pre-C99 systems, particularly Solaris,
> since IIRC it was present in an earlier version of the draft standard than
> stdint.h was.

Also, inttypes.h includes stdint.h on C99 hosts.  I don't know of any
hosts where it helps to include both files, and it's quite possible
that it might hurt on some pre-C99 hosts, so it's better to omit
stdint.h if inttypes.h exists.

C99 stdint.h exists only for freestanding environments --
i.e. environments without a C library, where the only available
headers are float.h, iso646.h, limits.h, stdarg.h, stdbool.h,
stddef.h, and stdint.h.  In effect, stdint.h is the freestanding part
of inttypes.h.

Is autoconf intended for freestanding environments?  The manual
doesn't say.  (Perhaps it should.)  I have the vague impression that
the answer is "no", but if I'm wrong then most likely:

     #if HAVE_INTTYPES_H
     # include <inttypes.h>
     #endif

should be changed to:

     #if HAVE_INTTYPES_H
     # include <inttypes.h>
     #else
     # if HAVE_STDINT_H
     #  include <stdint.h>
     # endif
     #endif

in the code and in the documentation, along with all the appropriate
underlying changes.

Reply via email to