Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!mcrware!jejones From: jejones@mcrware.UUCP (James Jones) Newsgroups: comp.os.os9 Subject: Re: Bugs in OS9/68K C-Compiler ? Summary: it really should do the same thing in both cases Message-ID: <822@mcrware.UUCP> Date: 28 Oct 88 10:25:15 GMT Article-I.D.: mcrware.822 References: <147@fbihh.UUCP> <636@tuvie> Organization: Microware Systems Corp., Des Moines, Ia. Lines: 13 In article <636@tuvie>, rzmul3@tuvie (Uni Leoben) writes: > For the 'return 0 != ptr' problem : I don't know why, but 'return ptr != 0' > works. Apparently the compiler automatically casts integers to pointers > on comparisons but doesn't cast pointers to integers. It really is supposed to do the same thing in both cases. It does look funny, but some folks recommend that style as a guard against mistakenly writing things like "if (ptr = 0) ...". BTW, the only integer in such comparisons that should make it past without a warning is 0. Anyway, said problem has been eradicated. James Jones