[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoconf-2.50 docs: Common Behavior/Default Includes
From: |
Paul Eggert |
Subject: |
Re: autoconf-2.50 docs: Common Behavior/Default Includes |
Date: |
Mon, 28 May 2001 22:03:25 -0700 (PDT) |
> From: Russ Allbery <address@hidden>
> Date: 28 May 2001 11:05:08 -0700
>
> Lars Hecking <address@hidden> 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.
- autoconf-2.50 docs: Common Behavior/Default Includes, Lars Hecking, 2001/05/28
- Re: autoconf-2.50 docs: Common Behavior/Default Includes, Russ Allbery, 2001/05/28
- FYI: Including stdint.h (Was: autoconf-2.50 docs: Common Behavior/Default Includes), Akim Demaille, 2001/05/31
- Re: FYI: Including stdint.h (Was: autoconf-2.50 docs: Common Behavior/Default Includes), Alexandre Oliva, 2001/05/31
- Re: FYI: Including stdint.h (Was: autoconf-2.50 docs: Common Behavior/Default Includes), Paul Eggert, 2001/05/31
- Re: FYI: Including stdint.h (Was: autoconf-2.50 docs: Common Behavior/Default Includes), Akim Demaille, 2001/05/31