Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!rutgers!att!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.c Subject: Re: When is a statement an expression? Summary: Xenix C gets it right: sur-prise sur-prise.... Message-ID: <306@oha.UUCP> Date: 6 May 89 08:27:41 GMT References: <1043@itivax.iti.org> Organization: Olekshy Hoover & Associates Ltd., Edmonton, Alberta, Canada Lines: 18 In <1043@itivax.iti.org>, Steve Simmons (scs@vax3.iti.org) writes... > > main() { int a = 0 ; a = if ( a == 1 ) 12 ; else 14 ; } > > We tried it out on all the C compilers we could find (BSD 4.3, Gould, > UNIX-PC, gcc) and it fails. But the error messages are quite cryptic... Well, well, well, if anyone praised the Xenix C compiler I would be the first to provide lists of bugs, but I tried the above (too tired to party) and cc said: @test.c(1) : error 59: syntax error : 'if' @test.c(1) : error 59: syntax error : 'constant' @test.c(1) : error 59: syntax error : 'else' Sounds right to me. Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).