Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ucbcad!ucbvax!decvax!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Scope of externals definitions Message-ID: <1288@haddock.ISC.COM> Date: Wed, 30-Sep-87 16:42:39 EDT Article-I.D.: haddock.1288 Posted: Wed Sep 30 16:42:39 1987 Date-Received: Sun, 4-Oct-87 23:05:01 EDT References: <8652@utzoo.UUCP> <69800001@cdp> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 16 Summary: Are they really being that strict? In article <69800001@cdp> cprodehl@cdp.UUCP writes: >Declaring a function (or prototype for that matter) inside block scope >is now [as of Sep87 X3J11 meeting] undefined behavior. If this is literally true, it seems a bit of overkill (though I could live with the restriction). In particular, if the function is never used outside of the block in which it's declared, the semantics are unambiguous and so I see no reason for it to be undefined behavior. (In fact, it's a useful documentation aid to give an object the smallest possible scope.) If, on the other hand, X3J11 is actually saying that something like f() { extern char *p(); ... } g() { ... p(); ... } produces undefined behavior, that seems perfectly reasonable. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint