• 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: GCC Standard Predefined Macros
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC Standard Predefined Macros


  • Subject: Re: GCC Standard Predefined Macros
  • From: Richard Somers <email@hidden>
  • Date: Sat, 8 Dec 2007 17:12:27 -0700

All,

I would like thank John Engelhart for his lengthy post on const objects in C to help educate us all on this subject.

I have discovered the root of my specific problem. The "basename" function prototype changed with Leopard and Apple's UNIX 03 certification.

The function argument was changed from "const char *" to "char *". The follow code fragment is found in the libgen.h header.

#if __DARWIN_UNIX03

char *basename(char *);

#else  /* !__DARWIN_UNIX03 */

char *basename(const char *);

#endif  /* __DARWIN_UNIX_03 */

This change is surprising to me. I would have thought that UNIX 03 would expect more out of a function not less.

Regards,
Richard

On Dec 7, 2007, at 9:49 AM, Richard Somers wrote:

The following simplified line of code complied fine on Xcode 2.x in my cocoa application.

   char *file = basename(__FILE__)

Xcode 3.0 complies the code with the following error: warning: passing argument 1 of "basename" discards qualifiers from pointer target type.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >GCC Standard Predefined Macros (From: Richard Somers <email@hidden>)

  • Prev by Date: Release problem only on quit
  • Next by Date: String Encodings
  • Previous by thread: Re: GCC Standard Predefined Macros
  • Next by thread: Best way to bind an Inspector to iVars/Properties?
  • Index(es):
    • Date
    • Thread