gcc-4.6: "ld: warning: -fwritable-strings not compatible with literal CF/NSString"

Anatol Pomozov anatol.pomozov at gmail.com
Fri Mar 4 18:37:22 PST 2011


Hi,

I am trying to implement a program that uses fsevent library on macosx.
http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html#//apple_ref/doc/uid/TP40005289-CH4-SW4

And I need some features (such as __thread) that are not supported
neither by outdated GCC from XCode nor by Clang. The only option is
GCC from MacPorts.

I installed GCC-4.6 from macports (gcc46 @4.6-20110226) and trying to
compile a fsevent sample.

When I try to compile it with gcc 4.6 it produces a weird warning:

$ gcc-mp-4.6 -framework CoreServices ld_warn.c
ld: warning: -fwritable-strings not compatible with literal CF/NSString in
/var/folders/++/++27Xk++6+0++4RjPqRgNE+-0Mw/-Tmp-//cc3B1vHB.o


The output binary looks OK.

When I try to compile the same sources either with gcc from XCode or
clang - it compiles without any warning.

It makes me think that this is an issue with GCC. So I filed a bug
against GCC http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47997 (that
bug has a repro case).

Bug the GCC teams says that -fwritable-strings has been removed from
FSF gcc since 2004.

Dear Macports team, do you happen to know what does the gcc warning mean?

PS I have macports 1.9.2 & macosx 10.6


More information about the macports-users mailing list