Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Mar 2000 15:41:59 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        John Polstra <jdp@polstra.com>, paul@originative.co.uk, current@FreeBSD.ORG
Subject:   Re: MAX_UID ?
Message-ID:  <Pine.BSF.4.21.0003141530500.2646-100000@alphplex.bde.org>
In-Reply-To: <20000314035420.B17084@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 14 Mar 2000, Giorgos Keramidas wrote:

> On Mon, Mar 13, 2000 at 05:28:47PM +1100, Bruce Evans wrote:
> ...
> > #define isschar(type)	(!isfloat(type) && issigned(type) && sizeof(type) == 1)

> This is marvellous in it's simplicity of interface.
> 
> Yet, using sizeof(char) and assuming that it's going to be 1, strikes me
> like a dangerous thing to do.  I have never heard of machines where this

It is sure to be 1 (the C standard requires this).  The problem is
going in the opposite direction -- sizeof(long) may also be 1.
sizeof(signed char) == sizeof(long) doesn't imply that SCHAR_MAX ==
LONG_MAX, so the macros may give the wrong result for:

    typedef long foo_t;
    ...
    assert(maxof(foo_t) == LONG_MAX);

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0003141530500.2646-100000>