Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!sdcsvax!akgua!mcnc!ecsvax!dgary From: dgary@ecsvax.UUCP Newsgroups: net.lang.c Subject: Re: K&R App A, par. 8 & 8.2, on Declarations, Defaulting. Message-ID: <2905@ecsvax.UUCP> Date: Wed, 11-Jul-84 11:52:08 EDT Article-I.D.: ecsvax.2905 Posted: Wed Jul 11 11:52:08 1984 Date-Received: Sat, 14-Jul-84 01:20:17 EDT References: hou3c.664 <180@log-hb.UUCP> <1027@hao.UUCP> Lines: 18 <> >From: ka@hou3c.UUCP Thu Jul 5 23:59:08 1984 >The statement "a = 1;" should be a valid global declaration. For >declarations inside a function, "int a = 1;" should be required. > Kenneth Almquist I agree that "a = 1;" should be a valid global declaration, but see nothing wrong with it as a local one. The statements "int a=1;" "int a; a = 1;" and "a = 1;" should all produce equivalent code! This is because of the way C handles initialization of automatic local variables. The only problem I can see is in letting the compiler tell where the declarations end and the statements begin. If you allow this as a valid declaration, that's not a problem. D Gary Grady Duke University Computation Center, Durham, NC 27706 (919) 684-4146 USENET: {decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary