Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: When is a statement an expression? Message-ID: <1989Apr27.162846.23039@utzoo.uucp> Organization: U of Toronto Zoology References: <1043@itivax.iti.org> Date: Thu, 27 Apr 89 16:28:46 GMT To address the Subject line first, a statement is NEVER an expression in C. In article <1043@itivax.iti.org> scs@vax3.iti.org (Steve Simmons) writes: > a = if ( a == 1 ) > 12 ; > else > 14 ; This is an interesting construct, but it's not legal C. Probably some compiler writer's bright idea. >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 >(we like gcc: "parse error after 'a'") and largely don't address >the real problem... When you feed a compiler something that it considers gibberish, it's fairly normal for the error messages to be a bit cryptic. -- Mars in 1980s: USSR, 2 tries, | Henry Spencer at U of Toronto Zoology 2 failures; USA, 0 tries. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu