Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Definition of boolean type Message-ID: <15906@mimsy.UUCP> Date: 11 Feb 89 02:39:31 GMT References: <10@dbase.UUCP> <9609@smoke.BRL.MIL> <3645@arcturus> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 26 In article <3645@arcturus> evil@arcturus.UUCP (Wade Guthrie) writes: >Why make a simple idea more complicated? Indeed. Perhaps the biggest problem with boolean types, and definitions for `TRUE' and `FALSE' (or True and False or true and false or . . .) is exemplified by the QDSS driver supplied with 4.3BSD-tahoe (for which no one at Berkeley is at fault). It had the following definitions (somewhat paraphrased): #define FALSE 0 #define TRUE ~FALSE ... /* these macros return TRUE when the queue is empty/full/... */ #define ISEMPTY(eq) ((eq)->head.foo == (eq)->tail.foo) The code then read if (ESEMPTY(eq) == TRUE) bar(); It is left as an exercise to the reader to determine why this test will never call function bar(). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris