This is the mail archive of the gcc@gcc.gnu.org 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: Compiling GCC With a C++ Compiler (g++)



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


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