Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site myriasa.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!alberta!myriasb!myriasa!cg From: cg@myriasa.UUCP (Chris Gray) Newsgroups: net.lang.c Subject: if (X) <==> if (X != 0) Message-ID: <173@myriasa.UUCP> Date: Fri, 13-Sep-85 12:26:50 EDT Article-I.D.: myriasa.173 Posted: Fri Sep 13 12:26:50 1985 Date-Received: Sat, 14-Sep-85 17:34:21 EDT References: <118@mit-hector.UUCP> <2792@sun.uucp> Organization: Myrias Research, Edmonton Lines: 22 We're going though the usual arguments about how the type 'boolean' should be fudged, and I came across this example: typedef enum {FALSE, TRUE} bool; f() { bool flag; if (flag) { printf("Hello\n"); } if (flag != 0) { printf("Good-bye\n"); } } The BSD 4.2 C compiler is happy about the first 'if', but warns about 'enumeration type clash' on the second. This at least is one case where 'if (X)' isn't the same as 'if (X != 0)'. Chris Gray {...,ihnp4}!alberta!myrias!cg