• 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: Fri, 7 Dec 2007 10:05:17 -0700

John,

Thanks for your help. I will study my C more carefully (again).

Richard

On Dec 7, 2007, at 9:52 AM, John Stiles wrote:

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?


_______________________________________________

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>)
 >Re: GCC Standard Predefined Macros (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Imaginary File Path
  • Next by Date: Re: Imaginary File Path
  • Previous by thread: Re: GCC Standard Predefined Macros
  • Next by thread: Re: GCC Standard Predefined Macros
  • Index(es):
    • Date
    • Thread