Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!adm!lamonts@Sds.Sdsc.EDU From: lamonts@Sds.Sdsc.EDU (Steve Lamont) Newsgroups: comp.lang.c Subject: Eating cycles Message-ID: <11339@brl-adm.ARPA> Date: 20 Jan 88 04:08:15 GMT Sender: news@brl-adm.ARPA Lines: 45 "Lawrence V. Cipriani" says > I was looking over the Oct '86 draft and noticed a couple of > things I believe are deficiencies. If these have been corrected > then n this posting. > 1) In the definition of statement (section 3.6) one of the legal > forms of statement is the expression and null statement (section > 3.6.3). The syntax is: > expression-statement: > expression ; > opt > Looking at the definitions of the various types of expressions > it looks like the following are valid *statements*: > i; > j << 2; > k == 0; > "hello world\n"; > I believe this is a deficiency. These statements have no effect > (other than eating a machine cycle which might be desired I guess), > and in fact lint flags them. This is related to the "language Actually, it always has been this way... otherwise things like fprintf( stderr, "Returns a value...\n" ); (among other functions) would produce an error... since fprintf _returns_ an int (which is always ignored). Our version of lint on the Cray, I believe, _does_ complain mildly about this, in fact. spl ---------------------------------------- Internet: LAMONTS@SDS.SDSC.EDU Bitnet: LAMONTS@SDSC Span: SDSC::LAMONTS (27.1) USPS: Steve Lamont San Diego Supercomputer Center P.O. Box 85608 San Diego, CA 92138 AT&T: 619.534.5126