This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Anonymous Namespaces
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> Kevin Atkinson <kevina@gnu.org> writes:
>
> | Is there a reason gcc 3.4 does not treat functions inside an anonymous
> | namespace as having static linkage.
>
> Because the C++ standard says those thingies have external linkage.
This doesn't preclude our doing optimizations on the information that
thingies inside an anonymous namespace can only be accessed from the
current translation unit. Further, if a conforming program can't tell
the difference, I don't see why we couldn't tag those symbols local in
the object file. This would, at least, avoid the need for the
random-bytes mess.
zw