[comp.lang.c] Eating cycles

lamonts@Sds.Sdsc.EDU (Steve Lamont) (01/20/88)

"Lawrence V. Cipriani" <lvc@tut.cis.ohio-state.EDU> 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