• 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: Robert Kuilman <email@hidden>
  • Date: Thu, 6 May 2004 16:34:13 +0200

Okay, but what is the exact solution to this problem?
I've been casting pointers like crazy, but that didn't help at all...

With Kind Regards,


Robert K.

-----------------------------{ Official Cocoa Newbie! }-----------------------------
web: http://halfduplex.net/
email: email@hidden

On May 5, 2004, at 9:43 PM, Reni Puls wrote:

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.
_______________________________________________
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.


References: 
 >NSApplicationMain const warning (From: René Puls <email@hidden>)
 >Re: NSApplicationMain const warning (From: Allan Odgaard <email@hidden>)
 >Re: NSApplicationMain const warning (From: René Puls <email@hidden>)

  • Prev by Date: Re: Adding Document Types Programmatically
  • Next by Date: Re: Adding Document Types Programmatically
  • Previous by thread: Re: NSApplicationMain const warning
  • Next by thread: GLobal Variables and Object
  • Index(es):
    • Date
    • Thread