This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9393: [3.2/3.3/3.4 regression] Anonymous namespaces and compiling the same file twice
- From: Geoffrey Keating <geoffk at apple dot com>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 10 Apr 2003 23:56:00 -0000
- Subject: Re: c++/9393: [3.2/3.3/3.4 regression] Anonymous namespaces and compiling the same file twice
- Reply-to: Geoffrey Keating <geoffk at apple dot com>
The following reply was made to PR c++/9393; it has been noted by GNATS.
From: Geoffrey Keating <geoffk at apple dot com>
To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, bangerth at ices dot utexas dot edu,
gcc-prs at gcc dot gnu dot org
Cc:
Subject: Re: c++/9393: [3.2/3.3/3.4 regression] Anonymous namespaces and compiling the same file twice
Date: Thu, 10 Apr 2003 16:49:01 -0700
A better testcase is:
#include <iostream>
namespace {
struct S {
S();
};
S::S () { std::cout << "One more call" << std::endl; }
S local_s;
}
(you can insert anything you like in the constructor). You can have as
many of these as you like in your program.
One additional problem with the existing behaviour is that you get
"determinism" only if inode numbers and modification times don't
change. This means that (a) it's not reproducible; users normally
can't control inode numbers; and (b) it's fragile, because both of
these can quietly vary, especially on network file systems.