Re: NSApplicationMain const warning
Re: NSApplicationMain const warning
- Subject: Re: NSApplicationMain const warning
- From: Ondra Cada <email@hidden>
- Date: Wed, 5 May 2004 18:30:24 +0200
On 5.5.2004, at 17:48, Reni Puls wrote:
>
APPKIT_EXTERN int NSApplicationMain(int argc, const char *argv[]);
>
>
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?
It of course does, in case you _pass a non const to a const-declared
arg_. Here it's alas the very opposite case: you are *defining* a func,
which has a non-const arg at the place of a const one. In other words,
you are crating a func which can internally change something what
somebody other believes it cannot.
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.