Bridged NSString/CFString, casts, and -Wcast-qual
Bridged NSString/CFString, casts, and -Wcast-qual
- Subject: Bridged NSString/CFString, casts, and -Wcast-qual
- From: Jim Correia <email@hidden>
- Date: Thu, 2 May 2002 18:26:32 -0400
I'd like to turn on -Wcast-qual since it can catch unintentional passing
of const arguments to non-const functions/methods.
The problem is that I have some CFStringRefs (either declared through a
macro which #define FOO CFSTR("FOO") because they are used by both
NSUserDefaults and CFPreferences, or that was returned by some system
API) that I'd like to pass to a routine/method that takes an NSString.
If I simply do the cast
someMethod: (NSString *)aCFStringRef
The compiler generates a warning.
I know that NSString is an immutable type, just like a CFString. How do
I write the cast so that I can tell the complier that so it doesn't
complain about this case, but I can keep -Wcast-qual on for other cases?
Thanks,
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.