Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.std.c Subject: Re: Omission re static linkage Message-ID: <12570029@hpclwjm.HP.COM> Date: 23 Oct 89 19:44:55 GMT References: <10975@riks.csl.sony.co.jp> Organization: Hewlett-Packard Calif. Language Lab Lines: 31 > Consider the following program: > void f1() { > extern void f3(void); /* [1] */ > } > void f2() { > static void f3(void); /* [2] */ > } > static void f3() { /* [3] */ > } > According to section 3.1.2.2, declarations [1] and [3] refer to the > same identifier, and function f3 has internal linkage. No, as I read it, the f3 declared in [1] has external linkage because there is no visible declaration with file scope at that point. The f3 declared in [3] does indeed have internal linkage. Because the same identifier appears with both external and internal linkage, behavior is undefined. > However, the > standard neglects to state what declaration [2] refers to. Declaration [2] violates a constraint of 3.5.1: "The declaration of an identifier for a function that has block scope shall have no explicit storage-class specifier other than extern." > Norman Diamond, Sony Corp. Walter Murray ----------