• 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: -fwritable-strings not compatible with literal CF/NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -fwritable-strings not compatible with literal CF/NSString


  • Subject: Re: -fwritable-strings not compatible with literal CF/NSString
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 2 Oct 2009 22:44:49 -0500

On Oct 2, 2009, at 10:20 AM, email@hidden wrote:

What exactly is this trying to tell me?

Seems pretty clear to me. You must not use -fwritable-strings and either CFSTR or @"" together. They aren't compatible.


Is this a 'new' incompatibility, or
one the Xcode has just now realized it should remind me of?

Not sure, but I doubt it's a new incompatibility.

I'm not
actually modifying any strings created with this macro, so does that mean this is a
victimless crime (and if so, how can I turn off these warnings)? Or will
these now all leak memory if not CFReleased? Is there a compiler directive I
can use to toggle writable strings off and on within the code,

Why are you using -fwritable-strings in the first place? Just remove that compiler flag and fix any resulting errors or warnings. From the gcc man page:


"This is for compatibility with old programs which assume they can write into string constants. Writing into string constants is a very bad idea; ‘constants’ should be constant. This option is deprecated."

or a way to specify this option on a per-file basis?

Yes, Xcode allows you to set build settings per-file. See here (this is in the iPhone Reference Library because the Xcode Project Management Guide seems to be missing from the Mac Reference Library):


https://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/210-Building_Products/building.html #//apple_ref/doc/uid/TP40002693-CHDBDDBI

Regards,
Ken

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >-fwritable-strings not compatible with literal CF/NSString (From: email@hidden)

  • Prev by Date: Re: Newbie question: using targets
  • Next by Date: Re: Any way to get 16-bit string literals?
  • Previous by thread: -fwritable-strings not compatible with literal CF/NSString
  • Next by thread: Re: Where can I find Debug & Profile Libraries for 10.6 ?
  • Index(es):
    • Date
    • Thread