This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: different address spaces
- From: Paul Schlie <schlie at comcast dot net>
- To: Zack Weinberg <zack at codesourcery dot com>,James E Wilson <wilson at specifixinc dot com>
- Cc: Martin Koegler <mkoegler at auto dot tuwien dot ac dot at>,<gcc at gcc dot gnu dot org>
- Date: Sat, 23 Apr 2005 10:15:57 -0400
- Subject: Re: different address spaces
> From: Zack Weinberg <zack@codesourcery.com>
>> James E Wilson <wilson@specifixinc.com> 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:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21018
(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?)