Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 alpha 4/15/85; site elsie.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!elsie!ado
From: ado@elsie.UUCP (Arthur David Olson)
Newsgroups: net.lang.c
Subject: Re: Cryptic C
Message-ID: <5208@elsie.UUCP>
Date: Sat, 24-Aug-85 12:21:43 EDT
Article-I.D.: elsie.5208
Posted: Sat Aug 24 12:21:43 1985
Date-Received: Sun, 25-Aug-85 13:41:48 EDT
References: <2913@ncsu.UUCP> <709@brl-tgr.ARPA> <1056@mtgzz.UUCP> <2076@ukma.UUCP> <685@gitpyr.UUCP>
Organization: NIH-LEC, Bethesda, MD
Lines: 29
Summary: The good news and the other news about (1==1)

> > > . . .I personally prefer:
> > >
> > >    #define	TRUE	1
> > >    #define	FALSE	0
> > > . . .
> > . . .I personally prefer:
> > 
> >	#define TRUE (1==1)
> >	#define FALSE (1==0)
> > . . .
> Oh?  On what machine is (1==1) equal to 0, or (1==0) not equal to 0? . . .

Yes, the good book (K&R) says that (1==1) is always 1.
The advantage of the second approach above is that it obviates the need to
remember this fact.  The disadvantage of the second approach above is that it
gives "lint" fits ("constant in conditional context").

As for what *I* prefer:

	#ifndef TRUE
	#define	TRUE	(1)
	#define FALSE	(0)
	#endif

where the parenthesized definitions match those in "curses.h" to ensure that
if a reference to "curses.h" appears after the above lines I won't get a
"macro redefined to a different value" diagnostic from the C preprocessor.

				--ado