Ambiguous conversions
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