From: Gabriel Dos Reis <gdr@cs.tamu.edu>
To: Andreas Schwab <schwab@suse.de>
Cc: Phil Edwards <phil@codesourcery.com>,
Zack Weinberg <zack@codesourcery.com>,
Geoffrey Keating <geoffk@apple.com>,
Ranjit Mathew <rmathew@gmail.com>,
gcc@gcc.gnu.org
Subject: Re: Compiling GCC With a C++ Compiler (g++)
Date: Wed, 13 Oct 2004 18:20:00 -0000 [thread overview]
Message-ID: <m3zn2q1voi.fsf@merlin.cs.tamu.edu> (raw)
In-Reply-To: <jeekk2wtjn.fsf@sykes.suse.de>
Andreas Schwab <schwab@suse.de> writes:
| Gabriel Dos Reis <gdr@cs.tamu.edu> writes:
|
| > Look at the current implementation of build_string
| >
| > tree
| > build_string (int len, const char *str)
| > {
| > tree s;
| > size_t length;
| [...]
| > s = ggc_alloc_tree (length);
| >
| [...]
| >
| > return s;
| > }
| >
| > The lvalue "s" is just nonmodifiable aoocording to the above language.
|
| (You probably mean "*s", since s is not const qualified).
Yes.
| But the object
| returned by ggc_alloc_tree _is_ modfiable. And this is what matters here.
| Just like
|
| const int *foo() { return malloc (sizeof (int)); }
|
| returns a pointer to a modfiable object, although the lvalue *foo() isn't.
You left too much out of my message. As I'm in hurry to get
something else done, I'll return back to you later, but in the
meantime, let me point out one thing:
Assume you can modify *s, then you still don't get anything useful
from Geoff's change, because the string could be modified anyway.
Therefore the "const" is there only to damage work done in the
direction of being able to compile GCC source with a C++ compiler.
-- Gaby
next prev parent reply other threads:[~2004-10-13 15:31 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-11 9:53 Ranjit Mathew
2004-10-12 10:06 ` Ranjit Mathew
2004-10-12 13:17 ` Gabriel Dos Reis
2004-10-12 21:15 ` Geoffrey Keating
2004-10-12 23:00 ` Gabriel Dos Reis
2004-10-12 23:23 ` Zack Weinberg
2004-10-13 2:53 ` Phil Edwards
2004-10-13 6:24 ` Gabriel Dos Reis
2004-10-13 10:57 ` Andreas Schwab
2004-10-13 13:16 ` Gabriel Dos Reis
2004-10-13 13:56 ` Andreas Schwab
2004-10-13 14:22 ` Gabriel Dos Reis
2004-10-13 15:06 ` Andreas Schwab
2004-10-13 15:22 ` Gabriel Dos Reis
2004-10-13 15:33 ` Andreas Schwab
2004-10-13 18:20 ` Gabriel Dos Reis [this message]
2004-10-13 19:09 ` Andreas Schwab
2004-10-13 11:47 ` Dave Korn
2004-10-13 12:24 ` Andreas Schwab
2004-10-13 13:29 ` Gabriel Dos Reis
2004-10-13 14:10 ` Andreas Schwab
2004-10-13 14:30 ` Dave Korn
2004-10-13 14:50 ` Dave Korn
2004-10-13 18:25 ` Andreas Schwab
2004-10-13 15:04 ` Joseph S. Myers
2004-10-13 17:01 ` Dave Korn
2004-10-13 21:16 ` Geoffrey Keating
2004-10-14 13:26 ` Dave Korn
2004-10-14 13:32 ` Gabriel Dos Reis
2004-10-14 18:40 ` Andreas Schwab
2004-10-14 18:48 ` Gabriel Dos Reis
2004-10-14 20:33 ` Geoffrey Keating
2004-10-14 20:19 ` Geoffrey Keating
2004-10-15 12:03 ` Kai Henningsen
2004-10-13 14:53 ` Gabriel Dos Reis
2004-10-13 15:46 ` Gabriel Dos Reis
2004-10-13 19:41 ` Matt Austern
2004-10-13 20:29 ` Andreas Schwab
2004-10-13 20:41 ` Matt Austern
2004-10-13 20:58 ` Phil Edwards
2004-10-13 9:23 ` Ranjit Mathew
2004-10-13 13:09 ` Ranjit Mathew
2004-10-13 19:13 ` Richard Henderson
2004-10-13 21:55 ` Gabriel Dos Reis
2004-10-13 13:29 ` Gabriel Dos Reis
2004-10-13 5:49 ` Gabriel Dos Reis
2004-10-13 9:19 ` Zack Weinberg
2004-10-13 13:45 ` Gabriel Dos Reis
2004-10-13 20:39 ` Geoffrey Keating
2004-10-13 21:45 ` Gabriel Dos Reis
2004-10-13 22:15 ` Geoffrey Keating
2004-10-13 22:24 ` Gabriel Dos Reis
2004-10-13 22:53 ` Joseph S. Myers
2004-10-13 23:19 ` Geoffrey Keating
2004-10-14 0:21 ` Gabriel Dos Reis
2004-10-14 6:04 ` Andreas Schwab
2004-10-14 7:10 ` Gabriel Dos Reis
2004-10-14 11:29 ` Andreas Schwab
2004-10-14 13:06 ` Gabriel Dos Reis
2004-10-14 18:37 ` Andreas Schwab
2004-10-15 12:48 ` Kai Henningsen
2004-10-13 3:47 Steven L. Zook
2004-10-13 7:26 ` Gabriel Dos Reis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3zn2q1voi.fsf@merlin.cs.tamu.edu \
--to=gdr@cs.tamu.edu \
--cc=gcc@gcc.gnu.org \
--cc=geoffk@apple.com \
--cc=phil@codesourcery.com \
--cc=rmathew@gmail.com \
--cc=schwab@suse.de \
--cc=zack@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).