This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Static linkage and anonymous namespace
>>>>> "Martin" == Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
Martin> It is currently easy to produce duplicate symbols if you
Martin> know the algorithm for the anonymous namespace name. Is
Martin> this a problem? If so, should we merge the current time
Martin> into the name?
Yes. And any other random bits that you can come up with.
(Seriously, picking 1024 random bits and tacking them on to the name
is not the worst idea imaginable here; it should reduce the chance of
collision to a negligible probability.)
Martin> Martin
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com