bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stdint vs cycle-check.h


From: Mark D. Baushke
Subject: stdint vs cycle-check.h
Date: Tue, 20 Jun 2006 11:00:27 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Bruno & Jim,

A system without an <stdint.h> file, will have the stdint_.h turned into
a valid one. However, the HAVE_STDINT_H will not be defined. This causes
problems with files like cycle-check.h which does:

# if HAVE_STDINT_H
#  include <stdint.h>
# endif

Similar things happen with these lib/*.h files:

  size_max.h regex_internal.h size_max.h xsize.h

is it desirable to make those modules depend on stdint.m4 and avoid the
HAVE_STDINT_H macro?

Worth noting is that the CVS project is still seeing some problems on
the SGI platform. The baseline problem appears to be that <inttypes.h>
defines all of the types needed, but none of the tests to create
stdint.h take that into account. At a guess, building up the skeleton of
what will be the stdint.h by doing the include of <inttypes.h> and THEN
determining which types are missing would make it all work.

On the SGI in /usr/include/stdint.h we see the code:

#ifndef __STDINT_H__
#define __STDINT_H__

#ifndef __c99
#error This header file is to be used only for c99 mode compilations
#else

... all of the types we really needed or wanted ...

#endif /* __c99 */

#endif /* __STDINT_H__ */

The #error does not cause the compilation to 'fail', so the typical
configure tests are not as optimal.

On the SGI in /usr/include/inttypes.h we see the code:

#if !(defined(__c99))

#ifndef __inttypes_INCLUDED
#define __inttypes_INCLUDED

... typedefs for these types:

    int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t
    intmax_t uintmax_t intptr_t uintptr_t

#endif

#if _SGIAPI
/* Define limits for the types, in the manner of limits.h: */

... #define lines for these macros:

    INT8_MIN INT8_MAX UINT8_MAX INT16_MIN INT16_MAX UINT16_MAX INT32_MIN
    INT32_MAX UINT32_MAX INT64_MIN INT64_MAX UINT64_MAX INTMAX_MIN
    INTMAX_MAX UINTMAX_MAX

    INT8_C(c) UINT8_C(c) INT16_C(c) UINT16_C(c) INT32_C(c) UINT32_C(c)
    INT64_C(c) UINT64_C(c) INTMAX_C(c) UINTMAX_C(c)

many other typedefs et al.

#endif /* __c99 */

        -- Mark

The configure output looks something like this:
...
checking for gcc... cc -mips3
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
...
checking whether we are using the GNU C compiler... no
checking whether cc -mips3 accepts -g... yes
checking for cc -mips3 option to accept ANSI C... none needed
checking dependency style of cc -mips3... sgi
checking how to run the C preprocessor... cc -mips3 -E
...
checking for stdint.h... yes
...
checking for stdint.h... (cached) yes
checking for stdint.h... (cached) yes
...
checking for stdint.h... yes
...
checking for stdint.h... (cached) yes
checking for SIZE_MAX... (((1U << 31) - 1) * 2 + 1)
checking for socklen_t... yes
checking for ssize_t... (cached) yes
checking for stdint.h... (cached) yes
checking full path to <stdint.h>... /usr/include/stdint.h
checking for inttypes.h... (cached) yes
checking full path to <inttypes.h>... (cached) /usr/include/inttypes.h
checking sys/inttypes.h usability... no
checking sys/inttypes.h presence... no
checking for sys/inttypes.h... no
checking sys/bitypes.h usability... no
checking sys/bitypes.h presence... no
checking for sys/bitypes.h... no
checking whether 'long' is 64 bit wide... no
checking whether 'long long' is 64 bit wide... yes
checking for int8_t... no
checking for int16_t... no
checking for int32_t... no
checking for int64_t... no
checking for uint8_t... no
checking for uint16_t... no
checking for uint32_t... no
checking for uint64_t... no
checking for int_least8_t... no
checking for int_least16_t... no
checking for int_least32_t... no
checking for int_least64_t... no
checking for uint_least8_t... no
checking for uint_least16_t... no
checking for uint_least32_t... no
checking for uint_least64_t... no
checking for int_fast8_t... no
checking for int_fast16_t... no
checking for int_fast32_t... no
checking for int_fast64_t... no
checking for uint_fast8_t... no
checking for uint_fast16_t... no
checking for uint_fast32_t... no
checking for uint_fast64_t... no
checking for intptr_t... no
checking for uintptr_t... no
checking for intmax_t... no
checking for uintmax_t... no
checking for int64_t... no
checking for uint64_t... no
checking for int_least64_t... no
checking for uint_least64_t... no
checking for int_fast64_t... no
checking for uint_fast64_t... no
checking for bit size of unsigned_int... 32
checking for bit size of long... 32
checking for bit size of unsigned_long... 32
checking for ptrdiff_t... yes
checking for bit size of ptrdiff_t... 32
checking for bit size of size_t... 32
checking for sig_atomic_t... yes
checking for bit size of sig_atomic_t... 32
checking whether sig_atomic_t is signed... yes
checking for bit size of wchar_t... 32
checking whether wchar_t is signed... yes
checking for wint_t... yes
checking for bit size of wint_t... 32
checking whether wint_t is signed... yes
checking for strncasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking whether <inttypes.h> defines strtoimax as a macro... no
checking for strtoimax... yes
checking for strtol... yes
checking for strtoll... yes
checking for strtoul... yes
checking for strtoull... yes
checking whether <inttypes.h> defines strtoumax as a macro... no
checking for strtoumax... yes
...
sed -e 's/@''HAVE_STDINT_H''@/1/g' \
    -e 's|@''FULL_PATH_STDINT_H''@|</usr/include/stdint.h>|g' \
    -e 's/@''HAVE_INTTYPES_H''@/1/g' \
    -e 's|@''FULL_PATH_INTTYPES_H''@|</usr/include/inttypes.h>|g' \
    -e 's/@''HAVE_SYS_INTTYPES_H''@/0/g' \
    -e 's/@''HAVE_SYS_BITYPES_H''@/0/g' \
    -e 's/@''HAVE_LONG_64BIT''@/0/g' \
    -e 's/@''HAVE_LONG_LONG_64BIT''@/1/g' \
    -e 's/@''HAVE_INT8_T''@/0/g' \
    -e 's/@''HAVE_INT16_T''@/0/g' \
    -e 's/@''HAVE_INT32_T''@/0/g' \
    -e 's/@''HAVE_INT64_T''@/0/g' \
    -e 's/@''HAVE_UINT8_T''@/0/g' \
    -e 's/@''HAVE_UINT16_T''@/0/g' \
    -e 's/@''HAVE_UINT32_T''@/0/g' \
    -e 's/@''HAVE_UINT64_T''@/0/g' \
    -e 's/@''HAVE_INT_LEAST8_T''@/0/g' \
    -e 's/@''HAVE_INT_LEAST16_T''@/0/g' \
    -e 's/@''HAVE_INT_LEAST32_T''@/0/g' \
    -e 's/@''HAVE_INT_LEAST64_T''@/0/g' \
    -e 's/@''HAVE_UINT_LEAST8_T''@/0/g' \
    -e 's/@''HAVE_UINT_LEAST16_T''@/0/g' \
    -e 's/@''HAVE_UINT_LEAST32_T''@/0/g' \
    -e 's/@''HAVE_UINT_LEAST64_T''@/0/g' \
    -e 's/@''HAVE_INT_FAST8_T''@/0/g' \
    -e 's/@''HAVE_INT_FAST16_T''@/0/g' \
    -e 's/@''HAVE_INT_FAST32_T''@/0/g' \
    -e 's/@''HAVE_INT_FAST64_T''@/0/g' \
    -e 's/@''HAVE_UINT_FAST8_T''@/0/g' \
    -e 's/@''HAVE_UINT_FAST16_T''@/0/g' \
    -e 's/@''HAVE_UINT_FAST32_T''@/0/g' \
    -e 's/@''HAVE_UINT_FAST64_T''@/0/g' \
    -e 's/@''HAVE_INTPTR_T''@/0/g' \
    -e 's/@''HAVE_UINTPTR_T''@/0/g' \
    -e 's/@''HAVE_INTMAX_T''@/0/g' \
    -e 's/@''HAVE_UINTMAX_T''@/0/g' \
    -e 's/@''BITSIZEOF_UNSIGNED_INT''@/32/g' \
    -e 's/@''BITSIZEOF_LONG''@/32/g' \
    -e 's/@''BITSIZEOF_UNSIGNED_LONG''@/32/g' \
    -e 's/@''BITSIZEOF_INT8_T''@//g' \
    -e 's/@''BITSIZEOF_INT16_T''@//g' \
    -e 's/@''BITSIZEOF_INT32_T''@//g' \
    -e 's/@''BITSIZEOF_INT64_T''@//g' \
    -e 's/@''BITSIZEOF_UINT8_T''@//g' \
    -e 's/@''BITSIZEOF_UINT16_T''@//g' \
    -e 's/@''BITSIZEOF_UINT32_T''@//g' \
    -e 's/@''BITSIZEOF_UINT64_T''@//g' \
    -e 's/@''BITSIZEOF_INT_LEAST8_T''@//g' \
    -e 's/@''BITSIZEOF_INT_LEAST16_T''@//g' \
    -e 's/@''BITSIZEOF_INT_LEAST32_T''@//g' \
    -e 's/@''BITSIZEOF_INT_LEAST64_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_LEAST8_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_LEAST16_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_LEAST32_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_LEAST64_T''@//g' \
    -e 's/@''BITSIZEOF_INT_FAST8_T''@//g' \
    -e 's/@''BITSIZEOF_INT_FAST16_T''@//g' \
    -e 's/@''BITSIZEOF_INT_FAST32_T''@//g' \
    -e 's/@''BITSIZEOF_INT_FAST64_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_FAST8_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_FAST16_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_FAST32_T''@//g' \
    -e 's/@''BITSIZEOF_UINT_FAST64_T''@//g' \
    -e 's/@''BITSIZEOF_INTPTR_T''@//g' \
    -e 's/@''BITSIZEOF_UINTPTR_T''@//g' \
    -e 's/@''BITSIZEOF_INTMAX_T''@//g' \
    -e 's/@''BITSIZEOF_UINTMAX_T''@//g' \
    -e 's/@''BITSIZEOF_PTRDIFF_T''@/32/g' \
    -e 's/@''SAME_TYPE_PTRDIFF_T_LONG''@/0/g' \
    -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/32/g' \
    -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/1/g' \
    -e 's/@''SAME_TYPE_SIG_ATOMIC_T_LONG''@/0/g' \
    -e 's/@''SAME_TYPE_SIG_ATOMIC_T_UNSIGNED_LONG''@//g' \
    -e 's/@''BITSIZEOF_SIZE_T''@/32/g' \
    -e 's/@''SAME_TYPE_SIZE_T_UNSIGNED_LONG''@/0/g' \
    -e 's/@''BITSIZEOF_WCHAR_T''@/32/g' \
    -e 's/@''HAVE_SIGNED_WCHAR_T''@/1/g' \
    -e 's/@''SAME_TYPE_WCHAR_T_LONG''@/1/g' \
    -e 's/@''SAME_TYPE_WCHAR_T_UNSIGNED_LONG''@//g' \
    -e 's/@''BITSIZEOF_WINT_T''@/32/g' \
    -e 's/@''HAVE_SIGNED_WINT_T''@/1/g' \
    -e 's/@''SAME_TYPE_WINT_T_LONG''@/1/g' \
    -e 's/@''SAME_TYPE_WINT_T_UNSIGNED_LONG''@//g' \
    < /u/scjones/cvs-nightly/lib/stdint_.h > stdint.h-t
mv stdint.h-t stdint.h
gmake[3]: Entering directory `/scratch/cvs-nightly/lib'
source='/u/scjones/cvs-nightly/lib/sighandle.c' object='sighandle.o' libtool=no 
\
DEPDIR=.deps depmode=sgi /bin/sh /u/scjones/cvs-nightly/build-aux/depcomp \
cc -mips3 -DHAVE_CONFIG_H -I. -I/u/scjones/cvs-nightly/lib -I..  -I../intl 
-Ino/include  -g -c /u/scjones/cvs-nightly/lib/sighandle.c
cc-1035 cc: WARNING File = /usr/include/stdint.h, Line = 5
  #error directive:  This header file is to be used only for c99 mode
          compilations

  #error This header file is to be used only for c99 mode compilations
   ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 76
  The indicated "typedef" name has already been declared (with same type).

  typedef signed char    int8_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 79
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned char  uint8_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 84
  The indicated "typedef" name has already been declared (with same type).

  typedef short          int16_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 87
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned short uint16_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 91
  The indicated "typedef" name has already been declared (with same type).

  typedef int            int32_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 94
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned int   uint32_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 105
  The indicated "typedef" name has already been declared (with same type).

  typedef long long      int64_t;
                         ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 119
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned long long uint64_t;
                             ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 234
  The indicated "typedef" name has already been declared (with same type).

  typedef long          intptr_t;
                        ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 237
  The indicated "typedef" name has already been declared (with same type).

  typedef unsigned long uintptr_t;
                        ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 247
  The indicated "typedef" name has already been declared (with same type).

  typedef int64_t  intmax_t;
                   ^

cc-1275 cc: WARNING File = ./stdint.h, Line = 254
  The indicated "typedef" name has already been declared (with same type).

  typedef uint64_t uintmax_t;
                   ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 90
  Macro "INT8_MIN" (declared at line 274 of "./stdint.h") has an incompatible
          redefinition.

  #define INT8_MIN      (-127-1)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 91
  Macro "INT8_MAX" (declared at line 281 of "./stdint.h") has an incompatible
          redefinition.

  #define INT8_MAX      (127)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 92
  Macro "UINT8_MAX" (declared at line 292 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT8_MAX     (255u)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 93
  Macro "INT16_MIN" (declared at line 300 of "./stdint.h") has an incompatible
          redefinition.

  #define INT16_MIN     (-32767-1)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 94
  Macro "INT16_MAX" (declared at line 307 of "./stdint.h") has an incompatible
          redefinition.

  #define INT16_MAX     (32767)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 95
  Macro "UINT16_MAX" (declared at line 318 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT16_MAX    (65535u)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 96
  Macro "INT32_MIN" (declared at line 326 of "./stdint.h") has an incompatible
          redefinition.

  #define INT32_MIN     (-2147483647-1)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 97
  Macro "INT32_MAX" (declared at line 333 of "./stdint.h") has an incompatible
          redefinition.

  #define INT32_MAX     (2147483647)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 98
  Macro "UINT32_MAX" (declared at line 344 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT32_MAX    (4294967295u)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 99
  Macro "INT64_MIN" (declared at line 359 of "./stdint.h") has an incompatible
          redefinition.

  #define INT64_MIN     (-9223372036854775807LL-1)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 100
  Macro "INT64_MAX" (declared at line 377 of "./stdint.h") has an incompatible
          redefinition.

  #define INT64_MAX     (9223372036854775807LL)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 101
  Macro "UINT64_MAX" (declared at line 398 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT64_MAX    (18446744073709551615uLL)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 102
  Macro "INTMAX_MIN" (declared at line 749 of "./stdint.h") has an incompatible
          redefinition.

  #define INTMAX_MIN    (-9223372036854775807LL-1)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 103
  Macro "INTMAX_MAX" (declared at line 764 of "./stdint.h") has an incompatible
          redefinition.

  #define INTMAX_MAX    (9223372036854775807LL)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 104
  Macro "UINTMAX_MAX" (declared at line 779 of "./stdint.h") has an incompatible
          redefinition.

  #define UINTMAX_MAX   (18446744073709551615uLL)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 140
  Macro "INT8_C" (declared at line 930 of "./stdint.h") has an incompatible
          redefinition.

  #define INT8_C(c)     ((int8_t) c)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 141
  Macro "UINT8_C" (declared at line 931 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT8_C(c)    ((uint8_t) __CONCAT__(c,u))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 142
  Macro "INT16_C" (declared at line 935 of "./stdint.h") has an incompatible
          redefinition.

  #define INT16_C(c)    ((int16_t) c)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 143
  Macro "UINT16_C" (declared at line 936 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT16_C(c)   ((uint16_t) __CONCAT__(c,u))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 144
  Macro "INT32_C" (declared at line 940 of "./stdint.h") has an incompatible
          redefinition.

  #define INT32_C(c)    ((int32_t) c)
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 145
  Macro "UINT32_C" (declared at line 941 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT32_C(c)   ((uint32_t) __CONCAT__(c,u))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 146
  Macro "INT64_C" (declared at line 949 of "./stdint.h") has an incompatible
          redefinition.

  #define INT64_C(c)    ((int64_t) __CONCAT__(c,ll))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 147
  Macro "UINT64_C" (declared at line 950 of "./stdint.h") has an incompatible
          redefinition.

  #define UINT64_C(c)   ((uint64_t) __CONCAT__(c,ull))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 148
  Macro "INTMAX_C" (declared at line 964 of "./stdint.h") has an incompatible
          redefinition.

  #define INTMAX_C(c)   ((int64_t) __CONCAT__(c,ll))
          ^

cc-1047 cc: WARNING File = /usr/include/inttypes.h, Line = 149
  Macro "UINTMAX_C" (declared at line 965 of "./stdint.h") has an incompatible
          redefinition.

  #define UINTMAX_C(c)  ((uint64_t) __CONCAT__(c,ull))
          ^

source='/u/scjones/cvs-nightly/lib/allocsa.c' object='allocsa.o' libtool=no \
DEPDIR=.deps depmode=sgi /bin/sh /u/scjones/cvs-nightly/build-aux/depcomp \
cc -mips3 -DHAVE_CONFIG_H -I. -I/u/scjones/cvs-nightly/lib -I..  -I../intl 
-Ino/include  -g -c /u/scjones/cvs-nightly/lib/allocsa.c
...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFEmDe7Cg7APGsDnFERAiRoAKDiGww4jP/bS1zuFowEjH/RH8kW/wCfY5pj
F98nJD0M1Zy/xJIdK9OCjAA=
=CpEA
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]