Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!necntc!ames!oliveb!dchen From: dchen@oliveb.UUCP Newsgroups: comp.lang.c Subject: COMMA separated expresses Message-ID: <1601@oliveb.UUCP> Date: Thu, 25-Jun-87 02:59:17 EDT Article-I.D.: oliveb.1601 Posted: Thu Jun 25 02:59:17 1987 Date-Received: Sat, 27-Jun-87 06:21:58 EDT Reply-To: dchen@oliveb.UUCP (Dennis T. Chen) Distribution: world Organization: Olivetti ATC; Cupertino, Ca Lines: 23 Why did my C compiler(came with 4.3bsd) complaint the "syntax error" with the following COMMA separated express statements in a function: funct() { int i = 0; if ( i == 0 ) printf("A\n"), return; /* syntax error here */ printf("END\n"); } But it works fine with if ( i == 0 ) printf("A\n"), exit(1); /* compile OK */ Could someone point this out ? It seems to me that rule 7.15 Comma operator, on page 192 of C Programming Language doesn't state much on this. Dennis Chen {allegra, hplabs, idi, ihnp4, sun}!oliveb!dchen