Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: notesfiles Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!hp-pcd!hpfclq!kah From: kah@hpfclq.UUCP Newsgroups: net.lang.c Subject: Re: K&R App A, par. 8 & 8.2, on Declarat Message-ID: <72300007@hpfclq.UUCP> Date: Sun, 8-Jul-84 09:59:00 EDT Article-I.D.: hpfclq.72300007 Posted: Sun Jul 8 09:59:00 1984 Date-Received: Sun, 8-Jul-84 09:03:24 EDT References: <180@log-hb.UUCP> Organization: Hewlett-Packard Fort Collins Systems Division - Fort Collins, CO Lines: 24 Nf-ID: #R:log-hb:-18000:hpfclq:72300007:000:646 Nf-From: hpfclq!kah Jul 5 08:59:00 1984 Re: whether a =1; can be a legal declaration. See K&R, Appendix A, 18.3 and 18.4. Note that the "declaration-list" productions you reference refer to statements -- ie, declarations within a function-definition. And here it is necessary to have either an sc-specifier or a type-specifier in order to distinguish a declaration statement from an expression statement. However, at the global level, declarations are data-definition's (see 18.4), and here both the type-specifier and (extern | static) are optional. So x; y = 1; are legal external data-definitions and are equivalent to int x; int y = 1; respectively. K.Harris hpfcla!kah