Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: static stuff... Message-ID: <6693@brl-smoke.ARPA> Date: Wed, 18-Nov-87 09:53:33 EST Article-I.D.: brl-smok.6693 Posted: Wed Nov 18 09:53:33 1987 Date-Received: Sat, 21-Nov-87 04:41:47 EST References: <3011@sigi.Colorado.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <3011@sigi.Colorado.EDU> swarbric@tramp.Colorado.EDU (SWARBRICK FRANCIS JOHN) writes: >First, what is the significance of making a static function? >Second, aren't all global variables automatically static. Is there any >reason to explicitly call them static? "static" is a C keyword that is heavily overloaded. It not only is used to mean "static storage duration" (as opposed to dynamically allocated), but it also is used to indicate "file scope" (as opposed to global scope). Sometimes it means both! The main reason for attaching "static" to a top-level function or datum in a source file is to prevent its name being visible to object modules produced from other source files (other "translation units"). A static datum is also pre-initialized (with 0s of appropriate type if no explicit initializer is given).