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