🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #903

Re: Why can't you define an external object twice and never use it?

#903
From: Walter Murray
Date: Mon, 13 Nov 1989 17:32
23 lines
1084 bytes
Paul Eggert writes:

> 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.

I think it's even worse.  As far as I can tell, even the following 
program is strictly conforming, but I'll be happy if someone can
prove otherwise.

      int object = 1;
      int object = 2;
      function () { return 3; }
      function () { return 4; }
      main () { }

Looks like an oversight in the dpANS.

Walter Murray
---
Technical Details
Message-ID: <12570030@hpclwjm.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter
References: <53@looney.twinsun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.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: Why can't you define an external object twice and never use it?
Message-ID: <12570030@hpclwjm.HP.COM>
Date: 13 Nov 89 17:32:32 GMT
References: <53@looney.twinsun.com>
Organization: Hewlett-Packard Calif. Language Lab
Lines: 23