This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Why are variables in anonymous namespaces not static?
- From: Geoffrey Keating <geoffk at apple dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 1 May 2003 18:06:08 -0700
- Subject: Why are variables in anonymous namespaces not static?
Can anyone tell me why
namespace { int i; }
doesn't give `i' static linkage?
`i' will be given a random assembler name like
_ZN20_GLOBAL__N_x.hOCQSA11iE which surely can't be referenced outside
this compilation anyway, since no other compilation will know what it
is. (The case for constructors is different, because they're found by
collect2.)
--
Geoff Keating <geoffk@apple.com>