Date: Fri, 28 Apr 2000 05:23:28 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Archie Cobbs <archie@whistle.com> Cc: obrien@freebsd.org, Brian Fundakowski Feldman <green@freebsd.org>, arch@freebsd.org Subject: Re: limits.h and styles; ANSIfication Message-ID: <Pine.BSF.4.21.0004280505330.2491-100000@alphplex.bde.org> In-Reply-To: <200004271758.KAA66218@bubba.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27 Apr 2000, Archie Cobbs wrote: > David O'Brien writes: > > > http://people.FreeBSD.org/~green/limits.patch > > > > Why are you removing the ()'s from the macros? They are there to protect > > the expansion and should stay. > > You don't need paretheses when C cannot possibly parse it any > other way.. eg "0xffff" is always the same as "(0xffff)" in C. > > It seems to me the paretheses were there previously to protect > the "-1" part. The -1 part is necessary to give the correct type. Parentheses are also necessary to protect unary minus in some contexts, e.g., -1["foo"] is the negation of the character at offset 1 in "foo", while (-1)["foo"] is the character at the (invalid) offset -1 in "foo". > As for > > #define QUAD_MIN (LONG_MIN) > > they're also unnecessary, inductively assuming the #definition of > LONG_MIN is itself suitably protected. I agree, but I can't see how to define QUAD_MIN correctly without using paretheses :-). The above gives it the wrong type (long instead of quad_t). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" 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.0004280505330.2491-100000>