Re: GCC Standard Predefined Macros
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