public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2166
@ 2001-04-15 19:16 mmitchel
0 siblings, 0 replies; 9+ messages in thread
From: mmitchel @ 2001-04-15 19:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: mmitchel@gcc.gnu.org
To: carlo@alinoe.com, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/2166
Date: 16 Apr 2001 02:07:54 -0000
Synopsis: More mangling bugs
State-Changed-From-To: open->closed
State-Changed-By: mmitchel
State-Changed-When: Sun Apr 15 19:07:54 2001
State-Changed-Why:
Not a bug: `test' is an external symbol so there cannot
be two object modules defining it.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2166&database=gcc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-17 18:06 Carlo Wood
0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 2001-04-17 18:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Carlo Wood <carlo@alinoe.com>
To: mmitchel@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/2166
Date: Wed, 18 Apr 2001 02:55:59 +0200
Please look again at my bug report.
'test' is not the variable that gives the problem,
it only magically turns up in the anonymous name of
the variable that this IS about: the one declared at
the bottom of the source file:
namespace {
int anonymous;
}
You misread my report.
Carlo
On Mon, Apr 16, 2001 at 02:07:54AM -0000, mmitchel@gcc.gnu.org wrote:
> Synopsis: More mangling bugs
>
> State-Changed-From-To: open->closed
> State-Changed-By: mmitchel
> State-Changed-When: Sun Apr 15 19:07:54 2001
> State-Changed-Why:
> Not a bug: `test' is an external symbol so there cannot
> be two object modules defining it.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2166&database=gcc
--
Carlo Wood <carlo@alinoe.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-17 20:56 Mark Mitchell
0 siblings, 0 replies; 9+ messages in thread
From: Mark Mitchell @ 2001-04-17 20:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Mark Mitchell <mark@codesourcery.com>
To: carlo@alinoe.com
Cc: mmitchel@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/2166
Date: Tue, 17 Apr 2001 20:54:54 -0700
>>>>> "Carlo" == Carlo Wood <carlo@alinoe.com> writes:
Carlo> You misread my report.
I don't think so.
I think that `test' has external linkage. Therefore, using it in this
mangled name is safe. You could only get a conflict if you had two
tests in two different translation units, both with external linkage.
And that would create a link error anyhow.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-17 23:56 Gabriel Dos Reis
0 siblings, 0 replies; 9+ messages in thread
From: Gabriel Dos Reis @ 2001-04-17 23:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Mark Mitchell <mark@codesourcery.com>
Cc: nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org, carlo@alinoe.com
Subject: Re: c++/2166
Date: 18 Apr 2001 08:53:42 +0200
Mark Mitchell <mark@codesourcery.com> writes:
| The following reply was made to PR c++/2166; it has been noted by GNATS.
|
| From: Mark Mitchell <mark@codesourcery.com>
| To: carlo@alinoe.com
| Cc: mmitchel@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
| Subject: Re: c++/2166
| Date: Tue, 17 Apr 2001 20:54:54 -0700
|
| >>>>> "Carlo" == Carlo Wood <carlo@alinoe.com> writes:
|
| Carlo> You misread my report.
|
| I don't think so.
|
| I think that `test' has external linkage.
Yes, it has.
| ... Therefore, using it in this
| mangled name is safe. You could only get a conflict if you had two
| tests in two different translation units, both with external linkage.
| And that would create a link error anyhow.
The Standard requires that a member of an anonymous namespace be
given a linker-visible unique name in a given translation unit so that
two different translation units don't mess up.
-- Gaby
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-18 0:06 Mark Mitchell
0 siblings, 0 replies; 9+ messages in thread
From: Mark Mitchell @ 2001-04-18 0:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Mark Mitchell <mark@codesourcery.com>
To: Gabriel.Dos-Reis@cmla.ens-cachan.fr
Cc: nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org, carlo@alinoe.com
Subject: Re: c++/2166
Date: Wed, 18 Apr 2001 00:05:48 -0700
>>>>> "Gabriel" == Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> writes:
Gabriel> The Standard requires that a member of an anonymous
Gabriel> namespace be given a linker-visible unique name in a
Gabriel> given translation unit so that two different translation
Gabriel> units don't mess up.
So, do you agree with me that things are OK, or with Carlo that there
is a problem?
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-18 0:46 Gabriel Dos Reis
0 siblings, 0 replies; 9+ messages in thread
From: Gabriel Dos Reis @ 2001-04-18 0:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Gabriel.Dos-Reis@cmla.ens-cachan.fr, nobody@gcc.gnu.org,
gcc-gnats@gcc.gnu.org, carlo@alinoe.com
Subject: Re: c++/2166
Date: 18 Apr 2001 09:40:39 +0200
Mark Mitchell <mark@codesourcery.com> writes:
| >>>>> "Gabriel" == Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> writes:
|
| Gabriel> The Standard requires that a member of an anonymous
| Gabriel> namespace be given a linker-visible unique name in a
| Gabriel> given translation unit so that two different translation
| Gabriel> units don't mess up.
|
| So, do you agree with me that things are OK, or with Carlo that there
| is a problem?
Well, what I meant is that g++ has to ensure that the construct
namespace {
int test;
};
can appear in different translation units (within the same program)
and each translation unit have its own idea of `test' -- the different
`test's should not cause any conflict at the linker level.
Carlo think that means the compiler should use the file-definition name
as part of the mangled name of `test'.
That is a way to achieve uniqueness. Another can be the time of
tranlation. Actually anything which can lead to uniqueness is good.
I ran several tests and I think the current scheme is not robust
enought -- it seems to use very few characters ( < 7) to fake
uniqueness.
I didn't run into *actual* problems (I ran only 5 tests) so I cannot
definitely say that there IS a problem. However, I think there is a
potential problem.
This issue deserve further investigation -- I would do that as soon as
I have a chance.
-- Gaby
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-18 1:06 Mark Mitchell
0 siblings, 0 replies; 9+ messages in thread
From: Mark Mitchell @ 2001-04-18 1:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Mark Mitchell <mark@codesourcery.com>
To: Gabriel.Dos-Reis@cmla.ens-cachan.fr
Cc: nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org, carlo@alinoe.com
Subject: Re: c++/2166
Date: Wed, 18 Apr 2001 00:59:00 -0700
>>>>> "Gabriel" == Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> writes:
Gabriel> I ran several tests and I think the current scheme is not
Gabriel> robust enought -- it seems to use very few characters ( <
Gabriel> 7) to fake uniqueness.
THat should be enough. Each character is chosen at random from 62
choices, or about 2^6. So, that's (2^6)^7 = 2^42 possible choices,
plus the input file name.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-18 1:16 Gabriel Dos Reis
0 siblings, 0 replies; 9+ messages in thread
From: Gabriel Dos Reis @ 2001-04-18 1:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Gabriel.Dos-Reis@cmla.ens-cachan.fr, nobody@gcc.gnu.org,
gcc-gnats@gcc.gnu.org, carlo@alinoe.com
Subject: Re: c++/2166
Date: 18 Apr 2001 10:07:09 +0200
Mark Mitchell <mark@codesourcery.com> writes:
| >>>>> "Gabriel" == Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr> writes:
|
| Gabriel> I ran several tests and I think the current scheme is not
| Gabriel> robust enought -- it seems to use very few characters ( <
| Gabriel> 7) to fake uniqueness.
|
| THat should be enough. Each character is chosen at random from 62
| choices, or about 2^6. So, that's (2^6)^7 = 2^42 possible choices,
| plus the input file name.
OK, so I think that should clarify things for Carlo.
-- Gaby
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: c++/2166
@ 2001-04-18 8:06 Carlo Wood
0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 2001-04-18 8:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/2166; it has been noted by GNATS.
From: Carlo Wood <carlo@alinoe.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: mmitchel@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/2166
Date: Wed, 18 Apr 2001 16:56:53 +0200
On Tue, Apr 17, 2001 at 08:54:54PM -0700, Mark Mitchell wrote:
> I don't think so.
>
> I think that `test' has external linkage. Therefore, using it in this
> mangled name is safe. You could only get a conflict if you had two
> tests in two different translation units, both with external linkage.
> And that would create a link error anyhow.
Ah... Ok. I am sorry, I really thought you meant that it was
the variable 'test' that had to be unique itself. It just appeared
to me as a bug since the compiler constantly used long names
including the input file name and random characters and then
suddenly I ran into one that didn't contain any random characters
at all etc. But I guess you're right.
Thanks for clarifying,
--
Carlo Wood <carlo@alinoe.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-04-18 8:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-15 19:16 c++/2166 mmitchel
2001-04-17 18:06 c++/2166 Carlo Wood
2001-04-17 20:56 c++/2166 Mark Mitchell
2001-04-17 23:56 c++/2166 Gabriel Dos Reis
2001-04-18 0:06 c++/2166 Mark Mitchell
2001-04-18 0:46 c++/2166 Gabriel Dos Reis
2001-04-18 1:06 c++/2166 Mark Mitchell
2001-04-18 1:16 c++/2166 Gabriel Dos Reis
2001-04-18 8:06 c++/2166 Carlo Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).