Article View: comp.std.c
Article #4020Initializing internal linkage block scope variables.
From: Christopher R. Volpe
Date: Mon, 18 Sep 1995 14:47
Date: Mon, 18 Sep 1995 14:47
21 lines
992 bytes
992 bytes
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? Gcc -ansi -pedantic accepts it without so much
as a peep, and I can't think of why it ought to be illegal, but apparently it
is.
--
Chris Volpe Phone: (518) 387-7766 (Dial Comm 8*833
GE Corporate R&D Fax: (518) 387-6560
PO Box 8, Schenectady, NY 12301 Email: volpecr@crd.ge.com
Technical Details
Message-ID:
<43k0p4$mjv@rdsunx.crd.ge.com>Path:
arc1-ca.pugleaf.net!bart.crd.ge.com!volpeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!bart.crd.ge.com!volpe From: volpe@bart.crd.ge.com (Christopher R. Volpe) Newsgroups: comp.std.c Subject: Initializing internal linkage block scope variables. Date: 18 Sep 1995 14:47:00 GMT Organization: GE Corporate Research & Development Sender: volpe@bart (Christopher R. Volpe) Distribution: world Message-ID: <43k0p4$mjv@rdsunx.crd.ge.com> Reply-To: volpe@ausable.crd.ge.com NNTP-Posting-Host: bart.crd.ge.com