I find myself casting return types alot to silence compiler warnings and it always makes me feel like i'm doing something wrong.
This example is Objective-c
const char *strBuf = [anNString UTF8String];
[anOutputStream write:strBufr maxLength:len];
This goves me a compiler warning as
-UTF8String returns const char *
and -write:maxLength: takes const uint8_t *
So, knowing no better i would usually add the cast to stop the nagging and carry on my merry way.
Is this bad style (on my part), or just the way it is?
I appreciate any thoughts or advice.