[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_TYPE_UINT64_T produces wrong result with GCC 3.4.4 on Tru64 UNIX
From: |
Eric Blake |
Subject: |
Re: AC_TYPE_UINT64_T produces wrong result with GCC 3.4.4 on Tru64 UNIX V4.0F |
Date: |
Tue, 20 Oct 2009 07:13:00 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Rainer Orth on 10/19/2009 9:23 AM:
> checking for uint64_t... unsigned int
> $ gcc-3.4.4 -c conftest.c
> conftest.c: In function `main':
> conftest.c:4: warning: right shift count >= width of type
> $ echo $?
> 0
Thanks for the report. It is indeed a bug, and we should be able to work
around it. We need to break x>>63 into the more appropriate
((x>>31)>>31)>>1 to work around this. But before I work on the necessary
m4 magic, is it also a problem with smaller types? In other words, what
happens with:
int
main ()
{
static int test_array [1 - 2 * !((unsigned char) -1 >> (32 - 1) == 1)];
test_array [0] = 0
;
return 0;
}
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrdt1wACgkQ84KuGfSFAYDYBgCdGUVtWQXg86nuIhf+uGpPxPLw
BcMAn3ORB43DHvJPsWkeLd+vuuCRjgl0
=QkCH
-----END PGP SIGNATURE-----