• 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: Nick Zitzmann <email@hidden>
  • Date: Wed, 5 May 2004 12:04:29 -0600

On May 5, 2004, at 9:48 AM, 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?

You can pass non-constant items and one-dimensional arrays into arguments that are marked as constant; that is allowed by C standards. What is _not_ allowed is passing a non-constant two-dimensional array, such as **argv, into an argument that is constant[1]. GCC is actually being nice about this one, since that should be an error rather than just a warning.

And as I pointed out last week, the template is correct; the NSApplicationMain() prototype is written incorrectly, because the C9X standard says that argv must be non-constant. I've filed a bug report on this, and if you find this annoying enough, then you should too...

Nick Zitzmann
<http://www.chronosnet.com/>

[1] <http://www.eskimo.com/~scs/C-faq/q11.10.html>
_______________________________________________
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>)

  • Prev by Date: Not skipping Descendents
  • Next by Date: Re: Scanning directory contents
  • Previous by thread: Re: NSApplicationMain const warning
  • Next by thread: Re: NSApplicationMain const warning
  • Index(es):
    • Date
    • Thread