Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 May 2003 19:17:50 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        nectar@freebsd.org
Cc:        des@ofug.org
Subject:   Re: incorrect enum warning?
Message-ID:  <20030501.191750.12268648.imp@bsdimp.com>
In-Reply-To: <20030501150713.GA34992@madman.celabo.org>
References:  <xzp7k9a67pf.fsf@flood.ping.uio.no> <20030501150713.GA34992@madman.celabo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20030501150713.GA34992@madman.celabo.org>
            "Jacques A. Vidrine" <nectar@freebsd.org> writes:
: > when 0x80000000 is clearly within the range of 'int' on all platforms
: > we support?
: 
: Guessing:
: C does not specify one's complement or two's complement representation
: of integers.  On a one's complement 32-bit platform, 0x80000000 is -0
: (negative zero), which cannot be an `int'.

No.

The reason is that 0x800000000 is a positive number that's bigger than
MAX_INT (which is 0x7fffffff).  It isn't bigger than an unsigned int,
but it is larger than an int, but the standard doesn't say 'unsigned
int' it says 'int' which implies signed.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030501.191750.12268648.imp>