This is really several questions, but anyway…
I’m working with a big project in XCode, relatively recently ported from MetroWorks (Yes, really) and there’s a bunch of warnings that I want to get rid of. Every so often an IMPORTANT warning comes up, but I never look at them because there’s too many garbage ones. So, if I can either figure out how to get XCode to stop giving the warning, or actually fix the problem, that would be great. Here are the warnings:
- It claims that
<map.h>is antiquated.
However, when I replace it with<map>
my files don’t compile. Evidently,
there’s something in map.h that isn’t
in map… - this decimal constant is unsigned only in ISO C90
This is a large number being compared to an unsigned long. I have even cast it, with no effect. -
enumeral mismatch in conditional expression:
<anonymous enum>vs<anonymous enum>
This appears to be from a ?: operator. Possibly that the then and else branches don’t evaluate to the same type? Except that in at least one case, it’s
(matchVp == NULL ? noErr : dupFNErr)And since those are both of type OSErr, which is mac defined… I’m not sure what’s up. It also seems to come up when I have other pairs of mac constants…
-
multi-character character constant
This one is obvious. The problem is that I actually NEED multi-character constants…
-
-fwritable-strings not compatible with literal CF/NSString
I unchecked the “Strings are Read-Only” box in both the project and target settings… and it seems to have had no effect…
Items in
<map.h>are in the global namespace while items in<map>are in the std namespace. Most likely you were just referring directly to the global versions and when you switched to<map>you were no longer seeing them because they moved tostd::. In source files add ausing namespace stdto move on quickly. In headers you’ll need to qualify uses of map-related items withstd::.I think you’ll need to qualify the literal constant value with a trailing UL so it knows the correct type of the literal.
Most likely the enums are in two separate OS defined anonymous enums. You can static_cast them to quiet the warning.
No idea on the multi-byte chars.
Can you disable -fwritable-strings? Can you refactor the code that needs to modify constant strings?