• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSApplicationMain const warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: NSApplicationMain const warning
      • From: Ondra Cada <email@hidden>
References: 
 >NSApplicationMain const warning (From: René Puls <email@hidden>)

  • Prev by Date: Re: Objective-C question
  • Next by Date: Re: NSApplicationMain const warning
  • Previous by thread: NSApplicationMain const warning
  • Next by thread: Re: NSApplicationMain const warning
  • Index(es):
    • Date
    • Thread