🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4025

Re: Initializing internal linkage block scope variables.

#4025
From: Denizen of the Deep
Date: Mon, 18 Sep 1995 16:18
25 lines
1151 bytes
In article <43k0p4$mjv@rdsunx.crd.ge.com>,
Christopher R. Volpe <volpe@ausable.crd.ge.com> wrote:
>For years I've used code like:
>
>foo()
>{
>  static int count_number_of_calls = 0;
>
>  count_number_of_calls++;
>  /* Do other stuff */
>}
>
>However, this appears to violate the fourth constraint in ANSI Classic section
>3.5.7. Am I reading this right?
>
>Chris Volpe

No, as far as I can tell your code is perfectly legal.  The constraint
to which you refer concerns itself with identifiers with block
scope and either internal or external linkage.  My reading of
ISO 6.1.2.2 (probably ANSI Classic 3.1.2.2) is that the identifier
count_number_of_calls above has NO linkage; thus the constraint does
not apply.

-Jon
Technical Details
Message-ID: <43k659$5t4@Radon.Stanford.EDU>
Path: arc1-ca.pugleaf.net!Xenon.Stanford.EDU!becker
References: <43k0p4$mjv@rdsunx.crd.ge.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!Xenon.Stanford.EDU!becker
From: becker@Xenon.Stanford.EDU (Denizen of the Deep)
Newsgroups: comp.std.c
Subject: Re: Initializing internal linkage block scope variables.
Date: 18 Sep 1995 16:18:49 GMT
Organization: Computer Science Department, Stanford University.
Message-ID: <43k659$5t4@Radon.Stanford.EDU>
References: <43k0p4$mjv@rdsunx.crd.ge.com>
NNTP-Posting-Host: xenon.stanford.edu