This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: x86-64 support for gas part I


> Date: Wed, 20 Dec 2000 22:42:02 +1100 (EST)
> From: Alan Modra <alan@linuxcare.com.au>
> cc: rth@redhat.com, jh@suse.cz, binutils@sourceware.cygnus.com,
>         patches@x86-64.org
> 
> On Wed, 20 Dec 2000, Geoff Keating wrote:
> 
> > In both old K&R compilers, and ISO C compilers, on machines with
> > 32-bit ints, 0xffffffff and 0x80000000 are of type 'unsigned int'.
> 
> I thought the rule for K&R hexadecimal constants was that they are of type
> 'int' unless they have an 'L' suffix, in which case they are of type
> 'long int'.  'unsigned int' doesn't get a mention, which is precisely why
> there can be a problem.  Under K&R, the above are signed constants, and
> will be sign extended when stored into a 64-bit integral type, assuming
> the compiler provides such a type.

I believe that _hexadecimal_ constants are always unsigned in K&R.  It is
decimal constants where the behaviour differs between K&R and ANSI
(because in ANSI, they can be unsigned, but in K&R they aren't).

[I'm just repeating what I've been told, we had a discussion about
this with respect to -Wtraditional for GCC.]

-- 
- Geoffrey Keating <geoffk@geoffk.org>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]