M
Marco Jez
What are the requirements imposed by the Standard on unnamed namespaces? I
mean, is the hidden name guaranteed to be unique across multiple translation
units, or only within the declaring translation unit?
My question comes from a problem I'm seeing with code compiled with MSVC++.
I have multiple files which declare types and variables whose name is the
same across units, but they're declared inside unnamed namespace and so
their fully-qualified name is supposed to be unique. By examining the
assembly listing of each translation unit I see that the compiler gave the
same hidden name to unnamed namespaces in different object files. The funny
thing is that it doesn't happen always...
Any clues?
Marco
mean, is the hidden name guaranteed to be unique across multiple translation
units, or only within the declaring translation unit?
My question comes from a problem I'm seeing with code compiled with MSVC++.
I have multiple files which declare types and variables whose name is the
same across units, but they're declared inside unnamed namespace and so
their fully-qualified name is supposed to be unique. By examining the
assembly listing of each translation unit I see that the compiler gave the
same hidden name to unnamed namespaces in different object files. The funny
thing is that it doesn't happen always...
Any clues?
Marco