bug-autoconf
[Top][All Lists]
Advanced

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

AC_TYPE_UINT64_T produces wrong result with GCC 3.4.4 on Tru64 UNIX V4.0


From: Rainer Orth
Subject: AC_TYPE_UINT64_T produces wrong result with GCC 3.4.4 on Tru64 UNIX V4.0F
Date: Mon, 19 Oct 2009 17:23:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (usg-unix-v)

I noticed that the AC_TYPE_UINT64_T macro in autoconf 2.64 produces a
wrong results on Tru64 UNIX V4.0F with GCC 3.4.4.  The platform lacks
both stdint.h and inttypes.h, so the macro needs to provide a value
itself.

Here's the test I used:

$ cat configure.ac
AC_INIT(uint64_t, 0.0)
AC_TYPE_UINT64_T
AC_CONFIG_HEADERS(config.h)
AC_OUTPUT
$ autoconf
$ autoheader
$ ./configure
[...]
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... yes
checking for uint64_t... unsigned int
configure: creating ./config.status
config.status: creating config.h

The value above is wrong: alpha-dec-osf is an LP64 platform, so this
should be unsigned long instead.

The problem is shown with the extracted testcase:

$ cat conftest.c
int
main ()
{
static int test_array [1 - 2 * !((unsigned int) -1 >> (64 - 1) == 1)];
test_array [0] = 0

  ;
  return 0;
}
$ gcc-3.4.4 -c conftest.c
conftest.c: In function `main':
conftest.c:4: warning: right shift count >= width of type
$ echo $?
0
$ gcc-4.5.0 -c conftest.c
conftest.c: In function 'main':
conftest.c:4:1: warning: right shift count >= width of type
conftest.c:4:12: error: storage size of 'test_array' isn't constant
$ echo $?
1

I'm not sure this is a problem in all versions of GCC 3.4 on that
platform or specific to the version I use, though.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University




reply via email to

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