bug-gnulib
[Top][All Lists]
Advanced

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

gnulib/stdint.h not defining typedefs causes failures with Boost


From: Alexandre Duret-Lutz
Subject: gnulib/stdint.h not defining typedefs causes failures with Boost
Date: Tue, 18 Nov 2008 18:59:57 +0100

Hi people,

This is actually the third time I send this mail.  Apparently mails
comming from lrde.epita.fr do not reach gnu.org :-(
I'm trying again from gmail.

We have started using gnulib in a C++ project that uses Boost.
One of our build host is now failing as follows:

  gnulib/stdint.h has "#define int8_t signed char"
  boost/cstdint.hpp has "using ::int8_t;"
  the compiler sees "using ::signed char;" and fails with
  [...]/boost/cstdint.hpp:88: error: expected unqualified-id before 'signed'
  [...]/boost/cstdint.hpp:88: error: expected `;' before 'signed'
  [...]/boost/cstdint.hpp:88: error: declaration does not declare anything

  My understanding is that C99 requires int8_t to be a typedef, so
  gnulib/stdint.h would be faulty.

Details:

  gnulib c6790e9ece33da10ea5e64c25e57a5488584786a from Nov 5.
  boost 1.34.1
  libc 2.3.6.ds1-13 (Debian 4.0 amd64)
  gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

  configure decides to instanciate gnulib/stdint.h because of this test:

configure:13662: checking whether stdint.h conforms to C99
configure:13841: gcc -c -g -O2  conftest.c >&5
conftest.c:211: error: negative width in bit-field 'check_UINT8_C'
conftest.c:213: error: negative width in bit-field 'check_UINT16_C'
configure:13847: $? = 1


Suggested fix:

  Replace

    #undef int8_t
    #define int8_t signed char

  by

    typedef signed char gl_int8_t;
    #undef int8_t
    #define int8_t gl_int8_t

The attached patch shows how I've modified my copy of the file.
-- 
Alexandre Duret-Lutz

Attachment: stdint.in.h.patch
Description: Text Data


reply via email to

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