This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: x86-64 support for gas part I
- To: alan at linuxcare dot com dot au
- Subject: Re: x86-64 support for gas part I
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: Wed, 20 Dec 2000 04:09:12 -0800
- CC: rth at redhat dot com, jh at suse dot cz, binutils at sourceware dot cygnus dot com, patches at x86-64 dot org
- References: <Pine.LNX.4.21.0012202200520.28902-100000@front.linuxcare.com.au>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
> 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>