Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!mit-eddie!uw-beaver!tektronix!teklds!zeus!bobr From: bobr@zeus.TEK.COM (Robert Reed) Newsgroups: comp.lang.c Subject: Re: functions declared inside blocks with storage class Message-ID: <1839@zeus.TEK.COM> Date: Thu, 11-Jun-87 16:31:51 EDT Article-I.D.: zeus.1839 Posted: Thu Jun 11 16:31:51 1987 Date-Received: Sat, 20-Jun-87 12:59:15 EDT References: <12570@vaxd.ARPA> Reply-To: bobr@zeus.UUCP (Robert Reed) Organization: CAE Systems Division, Tektronix Inc., Beaverton OR Lines: 23 In article <12570@vaxd.ARPA> mkhaw@vaxd.ARPA (Mike Khaw) writes: Given: foo1() { static int bar(); } ...lint complains about a "static" function declaration that "redefinition hides earlier one". Is lint just being stupid about "static" within a block and treating it like a variable declaration? "Static" applied to functions is equivalent to declaring them of private scope (i.e., restricted to the file/module in which they are declared. What does it mean to declare a forward reference to a private function within another function in a language which has no lexical scoping? Where could you place the definition of bar() such that it would be within the scope of foo1()? On the other hand, declaring "extern int bar();" has a clear meaning--declaring the accessibility of an external function for the scope of foo1(). -- Robert Reed, Tektronix CAE Systems Division, bobr@zeus.TEK