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: "Dave Korn" <dk at artimi dot com>
- To: "'Gabriel Dos Reis'" <gdr at cs dot tamu dot edu>,"'Phil Edwards'" <phil at codesourcery dot com>
- Cc: "'Zack Weinberg'" <zack at codesourcery dot com>,"'Geoffrey Keating'" <geoffk at apple dot com>,"'Ranjit Mathew'" <rmathew at gmail dot com>,<gcc at gcc dot gnu dot org>
- Date: Wed, 13 Oct 2004 10:22:34 +0100
- Subject: RE: Compiling GCC With a C++ Compiler (g++)
> -----Original Message-----
> From: gcc-owner On Behalf Of Gabriel Dos Reis
> Sent: 13 October 2004 04:47
> Phil Edwards writes:
>
> [...]
>
> | particular place. Since member init-lists aren't available
> for STRING_CST,
> | we have to cast away the const in build_string
>
> which is undefined behaviour by C rules (and C++ too).
I'll bet alias analysis just loves it too. Wouldn't using tricks like
this lead to a situation in the future (if and) when there's full IPA in gcc
and it can't bootstrap itself reliably any more?
> | The const should stay; C is not C++, and the way in which write-once
>
> Most certainly C is not C++, and nobody is arguing otherwise.
> However, there is a large and good intersection of both languages
> where useful programs can be expressed through constructs with defined
> meaning.
>
> Taking explicit steps to put in hackery that
>
> (1) is undefined behaviour;
> (2) break works to make the compiler compilable with C++ (which was
> agreed upon) is both unproductive and <bip censored>.
Deeply agree. There are other ways to enforce the desired semantics and
they're to do with good software engineering methodology.
The entire situation is eerily isomorphic to the thing about
RTX_UNCHANGING_P and stuff that does change but only once..... !
cheers,
DaveK
--
Can't think of a witty .sigline today....