https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775
Nathan Sidwell changed:
What|Removed |Added
Resolution|--- |FIXED
Status|ASSIGNED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775
Nathan Sidwell changed:
What|Removed |Added
Status|RESOLVED|ASSIGNED
CC|
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775
--- Comment #9 from pinskia at gmail dot com 2008-03-01 04:19 ---
Subject: Re: static object mangling conflicts with extern object
Sent from my iPhone
On Feb 29, 2008, at 20:05, "geoffk at geoffk dot org" <[EMAIL PROTECTED]
> wrote:
>
>
> --- Comment #8 from geoffk at geoffk do
Sent from my iPhone
On Feb 29, 2008, at 20:05, "geoffk at geoffk dot org" <[EMAIL PROTECTED]
> wrote:
--- Comment #8 from geoffk at geoffk dot org 2008-03-01 04:05
It should be mangled, because there are still three different things
named 'i' declared in this program, and so
--- Comment #8 from geoffk at geoffk dot org 2008-03-01 04:05 ---
Subject: Re: static object mangling conflicts with extern object
On 29/02/2008, at 5:57 AM, mueller at gcc dot gnu dot org wrote:
> extern "C" void abort();
> extern "C" { static int i; }
> int *p = &i;
> int main()
>
--- Comment #7 from mueller at gcc dot gnu dot org 2008-02-29 13:57 ---
how about
extern "C" void abort();
extern "C" { static int i; }
int *p = &i;
int main()
{
int i;
{
extern int i;
i = 1;
*p = 2;
if (i == 2)
abort ();
}
return 0;
}
in this case, the
--- Comment #6 from geoffk at gcc dot gnu dot org 2007-05-06 01:27 ---
That should do it.
--
geoffk at gcc dot gnu dot org changed:
What|Removed |Added
Status
--- Comment #5 from geoffk at gcc dot gnu dot org 2007-05-06 01:01 ---
Subject: Bug 31775
Author: geoffk
Date: Sun May 6 00:01:36 2007
New Revision: 124467
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124467
Log:
Index: libiberty/ChangeLog
2007-05-04 Geoffrey Keating <[EMAI
--- Comment #4 from geoffk at gcc dot gnu dot org 2007-05-02 01:46 ---
I just happen to have a patch which fixes this.
--
geoffk at gcc dot gnu dot org changed:
What|Removed |Added
---
--- Comment #3 from geoffk at gcc dot gnu dot org 2007-05-02 00:54 ---
You would add a translation unit that says
int i;
or similar. It's not "main::i", it's "::i", because of [basic.link] paragraph
7:
When a block scope declaration of an entity with linkage is not found to refer
to
--- Comment #2 from rguenth at gcc dot gnu dot org 2007-05-01 20:44 ---
How do you define main"::"i? That is, how'd you make the testcase work from a
second translation unit if it would fail now?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775
--- Comment #1 from geoffk at gcc dot gnu dot org 2007-05-01 19:56 ---
This testcase is the same principle, but might use a different code path in the
compiler:
extern "C" void abort();
extern int *p;
int main()
{
extern int i;
i = 1;
*p = 2;
if (i == 2)
abort ();
return
13 matches
Mail list logo