This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: gas will miscompile with SPARCompiler 3.0.1 on Solaris7
From: Alexandre Oliva <aoliva@cygnus.com>
Date: 07 Apr 2000 15:26:33 -0300
> Besides, adding casts this way is just a wart; any future maintainer
> would be right to simply remove them, since they are clearly
> unnecessary.
Nope. Just think of a compiler with 64-bit integers. 0xffffffff
would be *signed* int, not unsigned as it currently is. It may not
make any difference in this particular case, but in some tests in
other files, it does. So adding the case to unsigned is actually a
good thing.
0x... in C is defined to be unsigned. It is a bug for a compiler to
sign extend it. (A compiler is permitted to treat it as long if it
fits in long but does not fit in unsigned int, but that is not
happening here).
> Using N_ONES would be OK with me too, although it is rather awkward.
N_ONES would return a signed integer.
No, at least on a correct C compiler it returns an integer of type
bfd_vma, which is unsigned.
Ian