Compiling GCC With a C++ Compiler (g++)

Matt Austern austern@apple.com
Wed Oct 13 20:41:00 GMT 2004


On Oct 13, 2004, at 12:09 PM, Andreas Schwab wrote:

> Matt Austern <austern@apple.com> writes:
>
>> I think this discussion is probably best conducted using precisely the
>> wording in the C standard.  I don't believe the phrase "read-only" is
>> defined in that standard.  Here's my analysis.
>>
>> Clause 6.7.3/5 says "If an attempt is made to modify an object defined
>> with a const-qualified type through use of an lvalue with
>> non-const-qualified type, the behavior is undefined."
>
> Do we have an "object defined with a const-qualified type" in the first
> place?  I don't think we have.  The object in question is obtained by 
> the
> equivalent of malloc() (called ggc_alloc_stat here) which returns a
> modifiable object with a non-qualified type.

You're right, sorry.

			--Matt



More information about the Gcc mailing list