Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!ucla-cs!twinsun!rise.twinsun.com!eggert From: eggert@rise.twinsun.com (Paul Eggert) Newsgroups: comp.std.c Subject: Why can't you define an external object twice and never use it? Message-ID: <53@looney.twinsun.com> Date: 10 Nov 89 02:57:10 GMT Sender: news@twinsun.com Reply-To: eggert@twinsun.com (Paul Eggert) Organization: Twin Sun, Inc Lines: 18 The program int X = 0; int X = 0; main() { return 0; } is ``obviously'' not ANSI C, but where does the proposed ANSI standard say so? X has multiple external definitions with external linkage, but X is never used. 3.1.2.2 prohibits the same identifier from appearing with both internal and external linkage. 3.5's constraints prohibit multiple declarations of identifiers with no linkage, and also prohibit declarations in the same scope that refer to the same object but specify incompatible types. 3.7's constraints prohibit multiple external definitions with internal linkage. 3.7's semantics prohibit multiple external definitions of any identifier that is declared with external linkage and used in an expression. However, none of these prohibitions apply to the above program. What's wrong?