From mboxrd@z Thu Jan 1 00:00:00 1970 From: imp@bsdimp.com (Warner Losh) Date: Wed, 8 Nov 2017 13:36:40 -0700 Subject: [TUHS] C question for the historians In-Reply-To: <20171108190540.GA7241@mcvoy.com> References: <20171108181420.517711F949@orac.inputplus.co.uk> <20171108190540.GA7241@mcvoy.com> Message-ID: On Wed, Nov 8, 2017 at 12:05 PM, Larry McVoy wrote: > On Wed, Nov 08, 2017 at 06:14:20PM +0000, Ralph Corderoy wrote: > > is better then why stop there? Why not > > > > if (((w & MASK) != FALSE) == TRUE) > > > Thanks for this, that's the perfect come back to the pedantic folks. > It's also wrong. You couldn't flip it around to write if (((w & MASK) == TRUE) == TRUE) because that only works when MASK == 1. So it's dangerous since you can't apply the normal laws of algebra on it because you are comparing BOOLEANS and MASKS, which has always ended in pain... Warner -------------- next part -------------- An HTML attachment was scrubbed... URL: