This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: different address spaces

> From: Zack Weinberg <>
>> James E Wilson <> writes:
>>>   unnecessary, and error prone (as evidenced by string literal memory
>>>   references not being properly identified as READONLY, although their
>>>   equivalent array representations are treated properly for example?)
>> If true, that sounds like a bug.  This is the only interesting issue
>> here from my point of view.  You might consider filing a bug report into
>> bugzilla for this.  Or contributing a patch.
> This might just be the special case for string constants in C, that
> their type is "char*" despite their being allocated in read-only
> memory.  Paul, before filing a bug, find out whether -Wwrite-strings
> makes this alleged misbehavior go away; if it does, it's not a bug.

I just double checked, neither -Wwrite-strings nor -fconst-strings seems
to affect the READONLY attribute which should be associated with memory
references to static const strings; an earlier PR was already filed:

(with respect to: -Wwrite-strings, I would have thought that the option,
 although presently depreciated and disabled by default, would only have
 enabled writes to string literal references be specified at the language
 front-end level, but not affect the READONLY attribute associated with
 them at the tree level, as regardless of the option enabling such writes
 to be accepted, the objects are still a static literal constants, and may
 simply not be physically writeable regardless of -Wwrite-strings?)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]