declaring variable

Michael Paul Hunter bagpiper at oxy.edu
Thu Apr 6 06:55:12 AEST 1989


A friend of mind had a program that wasn't working properly. (what a nice start)
Within this program was a declaration that was similar to:

double A,
       B,
       fooY,
       fooX,
       whelp; /* <--- note this */
       WhatAmI,
       AndMoreVariables;

He was compiling his program under TurboC 2.0.	The compiler with all warning
turned on was not saying anything about the semi after whelp.  But It did
not appear to be allocating space for the variable....at least in the debugger
if there was a line of the form whelp=constant, whelp did not change
value.

Two questions:
    1) Why isn't WhatAmI, AndMoreVariables; a syntax error?  How does the
       grammar produce this?
    2) What happens on other machines....do most compilers say something
       and does lint howl?


				      Thank you,
					 Michael Hunter
					 bagpiper at oxy.edu



More information about the Comp.lang.c mailing list