🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2133

Re: Static function prototypes and definitions

#2133
From: Paul Eggert
Date: Thu, 15 Oct 1992 01:53
15 lines
1227 bytes
lmiller@aero.org (Lawrence H. Miller) writes:

>	If the declarator or type
>	specifier...appears outside of any block or list of
>	parameters, the identifier has file scope, which terminates
>	at the end of the translation unit.

>Now I interpret this to mean what it says: a function definition has
>FILE SCOPE, i.e., from the START to the END of the file.

It doesn't say that: it says only that file scope goes to the end of the file.
C is very much a declare-before-use language:
in C, file scope is from the declaration to the end of the file.
To quote chapter and verse, ANSI C 3.1.2.1 says a normal identifier
``has scope that begins just after the completion of its declarator.''
Technical Details
Message-ID: <bjGe^'n4@twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert
References: <1992Oct13.011303.27314@nntpd.lkg.dec.com> <1bhhe5INNf8f@news.aero.org> <bjFLFApU@twinsun.com> <1bi565INNgc1@news.aero.org>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!elroy.jpl.nasa.gov!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: Static function prototypes and definitions
Message-ID: <bjGe^'n4@twinsun.com>
Sender: usenet@twinsun.com
Nntp-Posting-Host: farside
Organization: Twin Sun, Inc
References: <1992Oct13.011303.27314@nntpd.lkg.dec.com> <1bhhe5INNf8f@news.aero.org> <bjFLFApU@twinsun.com> <1bi565INNgc1@news.aero.org>
Date: Thu, 15 Oct 1992 01:53:56 GMT
Lines: 15