Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!cup.portal.com!Devin_E_Ben-Hur From: Devin_E_Ben-Hur@cup.portal.com Newsgroups: comp.lang.c Subject: Re: declaring variable Message-ID: <16892@cup.portal.com> Date: 9 Apr 89 01:17:48 GMT References: <2585@ssc-vax.UUCP> Organization: The Portal System (TM) Lines: 48 >In article <26707@tiger.oxy.edu>, Michael Hunter writes: >| Within this program was a declaration that was similar to: >| double A, >| B, >| fooY, >| fooX, >| whelp; /* <--- note this */ >| WhatAmI, /* line 6 */ >| 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" ~ >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Horsepucky... here's TurboC 2.0's responce to the above input: Turbo C Version 2.0 Copyright (c) 1987, 1988 Borland International t.c: Error t.c 6: Declaration needs type or storage class *** 1 errors in Compile *** Available memory 393548 The original poster is either blind or the variables WhatAmI, AndMoreVariables are actually declared names (outside of the scope of the posted fragment) such that: WhatAmI, AndMoreVariables; parses as a C comma operator statement: , ; Devin_Ben-Hur@Cup.Portal.Com ...ucbvax!sun!portal!cup.portal.com!devin_ben-hur