A Little Quibble

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Dec 9 17:31:03 AEST 1988


In article <25200001 at uicsrd.csrd.uiuc.edu> mcdaniel at uicsrd.csrd.uiuc.edu writes:
>Does dpANS require that "1" be printed, or is the result not defined
>by dpANS?

It's undefined (use of an uninitialized auto in an initializer expression).
Questions like this are resolved by the "scope rules".

>Does the result change?

Yes, now "a=1\n" must be printed.

>- it's an interesting little quibble. :-)

Not really.

>- I would like to declare an invariant like this:
>	double nubie;
>	. . . compute nubie . . .
>	{const double nubie = nubie;
>	    . . . here, nubie is invariant . . .
>	}

Multiple use of the same name for different purposes in the same
section of code is considered horrible style by every programmer
I know.



More information about the Comp.std.c mailing list