declaring variable

David Geary dmg at ssc-vax.UUCP
Sat Apr 8 03:21:51 AEST 1989


In article <26707 at tiger.oxy.edu>, Michael Hunter writes:

|| 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?

   One answer:

   TurboC2.0 is broken in this regard.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ David Geary, Boeing Aerospace, Seattle                 ~ 
~ "I wish I lived where it *only* rains 364 days a year" ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Comp.lang.c mailing list