Re: NSApplicationMain const warning
Re: NSApplicationMain const warning
- Subject: Re: NSApplicationMain const warning
- From: René Puls <email@hidden>
- Date: Wed, 5 May 2004 21:43:01 +0200
Am 05.05.2004 um 20:19 schrieb Allan Odgaard:
On 5. May 2004, at 17:48, Reni Puls wrote:
So NSApplicationMain requires 'argv' to be an array of const char
pointers. Why does it matter if I pass it a non-const array? It's not
like I am forcing the function to modify the strings--if it wants to
consider them constant, that is fine with me. Shouldn't the C
compiler silently ignore this?
No it should not! :) The problem is that NSApplicationMain takes an
array of constant strings, but the array itself is not const, so it
could do this:
[...]
Okay, let's see if I understood this correctly: The basic problem is
that NSApplicationMain, with its current declaration, could assign a
char const * to one of my argvs, which it couldn't do if argv were an
array of char *. (Because assigning a char const * to a char * variable
would result in a warning, or perhaps even an error.)
I hadn't thought of that, but it makes sense. Thanks everyone for
explaining this. Sometimes C is much more complicated than it looks.
;-)
Kind regards,
Reni Puls
_______________________________________________
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.