• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Anonymous namespace clashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anonymous namespace clashes


  • Subject: Re: Anonymous namespace clashes
  • From: Tobias Ford <email@hidden>
  • Date: Thu, 1 Feb 2007 02:12:34 -0600

I believe that what you are trying to do is legitimate according to the spec, but gcc will bork when doing this. I also remember seeing this behavior across identical namespace in multiple files. Try defining the methods and variables as being static.

Every method and variable that is defined inside a private file's namespace should be declared static unless you want linking time to be larger than necessary.

On Jan 26, 2007, at 3:39 AM, Paul Walmsley wrote:

I've just experienced a problem with anonymous namespaces. I have two source files, each with a couple of private functions and variables in an anonymous namespace. Some of these happen to have the same name. I get a 'multiply-defined symbol' error on linking. Surely - if my understanding is correct - this shouldn't happen since anonymous namespaces are local to the translation unit?

Paul

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

------------------- Tobias Ford... tobias1482 'at' mac.com tford 'at' spacetimestudios.com ------------------- Sr Programmer @ space time studios for a generic space game mmo

"The Batman is Muhhammed Ali -- Jim Brown -- Shaft -- an' Super-Fly all rolled into one!" -- Batman #250 by Frank Robbins





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Next by Date: Re: Turning off 'deleting 'VOID*' is undefined' error
  • Next by thread: Re: Turning off 'deleting 'VOID*' is undefined' error
  • Index(es):
    • Date
    • Thread