From owner-freebsd-current Mon Mar 13 20:42:18 2000 Delivered-To: freebsd-current@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id EFB6537B5D8 for ; Mon, 13 Mar 2000 20:42:13 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (qmail 7505 invoked from network); 14 Mar 2000 04:42:10 -0000 Received: from bde.zeta.org.au (203.2.228.102) by gidora.zeta.org.au with SMTP; 14 Mar 2000 04:42:10 -0000 Date: Tue, 14 Mar 2000 15:41:59 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Giorgos Keramidas Cc: John Polstra , paul@originative.co.uk, current@FreeBSD.ORG Subject: Re: MAX_UID ? In-Reply-To: <20000314035420.B17084@hades.hell.gr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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