• 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
Ambiguous conversions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ambiguous conversions


  • Subject: Ambiguous conversions
  • From: "Mark Wagner" <email@hidden>
  • Date: Thu, 22 Jun 2006 15:50:49 -0700

Since converting a project from CodeWarrior to XCode, the compiler's
been notifying me about ambiguous conversions.

Example code (oFileName is a MFileName object, derived from the MString class):
   if('.' == oFileName[i])

The message:
   ISO C++ says that these are ambiguous, even though the worst
conversion for the first is better than the worst conversion for the
second:
   ../MODEL/MString.h:148: note: candidate 1: const wchar_t&
MString::operator[](long int) const
   /DEVELOPMENT xcode/TGEQ/TGEQ.prj/../MODEL/MEXAM.CPP:254: note:
candidate 2: operator[](const wchar_t*, int) <built-in>


Under CodeWarrior, these didn't even generate a warning. Under Xcode 1.5/gcc 3.3, the compiler gave a warning, but compiled anyway. Xcode 2.3/gcc 4.0 gives an error: "ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second". Should I be worried that attempting to compile this under XCode 2.5/gcc 4.1 will cause my computer to explode?

More seriously, how do I solve this?  Is there something I can change
in the function prototype, or do I need to go through the code and
change the thousands of lines that trigger this error?

Thanks,
Mark Wagner
_______________________________________________
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


  • Follow-Ups:
    • Re: Ambiguous conversions
      • From: Laurence Harris <email@hidden>
  • Prev by Date: Re: e: Removing items from a project using AppleScript
  • Next by Date: Re: Ambiguous conversions
  • Previous by thread: tab appears as line break.
  • Next by thread: Re: Ambiguous conversions
  • Index(es):
    • Date
    • Thread