• 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: John Stiles <email@hidden>
  • Date: Fri, 07 Dec 2007 08:52:09 -0800

You are passing a const char* to a function which takes a char*.
This was never legal C code.
strcpy __FILE__ into your own string before passing it into basename.
Also, this is not a Cocoa question.

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.

__FILE__ is a C string or a pointer to char so why the error message?

The following Apple link doesn't seem shed any light.

http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/Standard-Predefined-Macros.html


I have check on the web and can't seem to find any thing relevant.

Any ideas?

Regards,
Richard
_______________________________________________

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
_______________________________________________

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


  • Follow-Ups:
    • Re: GCC Standard Predefined Macros
      • From: John Engelhart <email@hidden>
    • Re: GCC Standard Predefined Macros
      • From: Richard Somers <email@hidden>
References: 
 >GCC Standard Predefined Macros (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: Imaginary File Path
  • Next by Date: Re: Why is the latest WebKit interacting with my NSThread?
  • Previous by thread: GCC Standard Predefined Macros
  • Next by thread: Re: GCC Standard Predefined Macros
  • Index(es):
    • Date
    • Thread