This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
oh no - not anonymous namespaces again ...
- From: Gianni Mariani <gmariani at chaincast dot com>
- To: gcc <gcc at gnu dot org>
- Date: Fri, 10 Jan 2003 09:20:17 -0800
- Subject: oh no - not anonymous namespaces again ...
- Organization: Chaincast, Inc
- Reply-to: gmariani at chaincast dot com
I have done some more research and I've come to a hypothesis that
internal linkage is the right solution for anonymous namespaces.
It turns out that the discussion between Jason and Martin in 1998
(see http://gcc.gnu.org/ml/gcc-patches/1998-08/msg00352.html) was
limited because of the unfamiliarity of how to implement export.
Since gcc has yet to implement export *and* it seems that to implement
export and templates, you're going to need to change the whole way
linking works anyway, the the argument - you need globals for export,
is just not relevant.
Reconsideration of the anonymoys namespace patch found in
http://gcc.gnu.org/ml/gcc-patches/1998-08/msg00291.html
is needed.
Background:
Since the "static" global symbol is deprecated, there is no way for gcc
to guarentee conflict free linking. This seems to be a significant
regression
from C. static also has some limitations that are resolved by the use of
anonymous namespaces, concluding that the best solution is to ``fix''
anonymous namespaces to elimiate the possibility of linker conflicts.