This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling GCC With a C++ Compiler (g++)
- From: Andreas Schwab <schwab at suse dot de>
- To: Matt Austern <austern at apple dot com>
- Cc: "'Gabriel Dos Reis'" <gdr at cs dot tamu dot edu>,"'Zack Weinberg'" <zack at codesourcery dot com>,"'Ranjit Mathew'" <rmathew at gmail dot com>,"'Phil Edwards'" <phil at codesourcery dot com>, gcc at gcc dot gnu dot org,Dave Korn <dk at artimi dot com>, "'Geoffrey Keating'" <geoffk at apple dot com>
- Date: Wed, 13 Oct 2004 21:09:44 +0200
- Subject: Re: Compiling GCC With a C++ Compiler (g++)
- References: <NUTMEGgh8qWO8OsmOP00000041e@NUTMEG.CAM.ARTIMI.COM><jeoej7x73u.fsf@sykes.suse.de><38636E80-1D45-11D9-B344-000393B2ABA2@apple.com>
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.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."