Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: Definition of boolean type Message-ID: <225800128@uxe.cso.uiuc.edu> Date: 11 Feb 89 15:36:00 GMT References: <10@dbase.UUCP> Lines: 19 Nf-ID: #R:dbase.UUCP:10:uxe.cso.uiuc.edu:225800128:000:579 Nf-From: uxe.cso.uiuc.edu!mcdonald Feb 11 09:36:00 1989 > #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(). And on some computers (FALSE == TRUE) returns 0, while on others (FALSE == TRUE) will return 1! (Hint: There are a few, a very few, C compilers for one's complement machines, and on some of those 0 == -0). I admit this is farfetched.