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
On Apr 7, 2000, Ian Lance Taylor <ian@zembu.com> wrote:
> 0x... in C is defined to be unsigned.
Not in C99. It is signed if it fits, unsigned otherwise. I'm not
sure about older standards.
> It is a bug for a compiler to sign extend it.
Indeed. If it doesn't fit in an `int', it should try an `unsigned
int', then a `long int', then `unsigned long int', then `long long
int', then `unsigned long long int'.
> 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.
Oops, that's right, sorry, I had misread the `bfd_vma' as
`bfd_signed_vma' in the definition of N_ONES.
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me