public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Zack Weinberg <zack@codesourcery.com>
Cc: Mark Mitchell <mark@codesourcery.com>,
	gcc@gcc.gnu.org, jason@redhat.com, dberlin@dberlin.org
Subject: Re: Compiling GCC with g++: a report
Date: Tue, 24 May 2005 07:39:00 -0000	[thread overview]
Message-ID: <m31x7xjb13.fsf@uniton.integrable-solutions.net> (raw)
In-Reply-To: <873bsdkuhj.fsf@codesourcery.com>

Zack Weinberg <zack@codesourcery.com> writes:

| Mark Mitchell <mark@codesourcery.com> writes:
| ...
| > Like you, I do think these problems are surmountable; but, also like
| > you, I think it would take some time to get all the problems solved.
| > I don't really think, though, that this is immediately relevant;
| > Gaby's trying to fix things that seem to me like they will actually
| > make for better C code, and, right now at least, going to C++ isn't on
| > the table. I think you agree that most of the changes Gaby wants to
| > make are for the better (with the possible exception of casting the
| > return value of malloc, which will be hidden in a macro that's
| > probably less error-prone that writing out the malloc calls directly)
| > -- but you're concerned about the fact that doing this work now might
| > make it too easy for us to switch to C++ without thinking about all
| > the issues?
| 
| Yes, that's what I'm trying to get at.  Secondarily, I don't want to
| lose some of the expressive power of C-that-is-not-C++ if we're not
| getting the expressive power of C++ in exchange -- for instance, I
| really don't want to have to avoid the set of C++ keywords when coding
| in C, or remember the semantic difference between C and C++ struct tags.

But we do not get any expressive power by using C++ keywords.  
Using C++ keywords just make it impossible to have better checking
provided by C++ compilers.  That is no gain.  It is a lost.
Furthermore, if you ever move to C++ as you wanted to do, you will
have to abondon those keywords anyway, so it does not represent any
essential to expressive power.  I find the insistance of using C++
keywords (while wishing for moving to C++) very inconsistent, if not
contrary to our coding conventions. 

| I'd change my tune if Gaby could demonstrate a place where the C++
| compiler caught a user-visible bug that the C compiler missed.  That
| would be worth the extra discipline.  All the bugs described so far,
| however, have been things that, while formally incorrect, haven't
| affected the visible behavior of the compiler.

That is an extreme statement.  First, I just complete the project this
afternoon.  Furthermore, the fact that a function was called with with
one argument, but its definition was poking at a second argument is a
bug whose effect is hard to trace down correcly.  But that was just
the first one I came across.  Furthermore, the benefits are not just
what bugs we can catch right now, but how we make it possible to build
free software based on GCC, and encourage more contributions.  I know
of a number of projects that are done with proprietary compilers, that
could have been done with GCC (and people are ready to move to GCC, I
know at a number of Codesourcery customers ;-)) if it were possible to
have GCC compilable with a C++ compiler.  Frankly, there does not seem
to be any benefit to obsctructing these patches that would align us
with our own coding conventions.

| (And I'd be less grumpy about coding to the intersection of C and C++
| if someone coded up warnings for the C compiler to catch things
| outside the intersection.)

Consider that to be a follow-up that I'm willing to do, if these
preliminary patches are in.  For sure, I do want to make sure that we
do not break things too easily.

-- Gaby

  parent reply	other threads:[~2005-05-24  7:04 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-23 11:50 Gabriel Dos Reis
2005-05-23 12:22 ` Ranjit Mathew
2005-05-23 19:07   ` Tom Tromey
2005-05-23 18:04 ` Gabriel Dos Reis
2005-05-24  4:57 ` Gabriel Dos Reis
2005-05-24  4:59   ` Joseph S. Myers
2005-05-24 21:50   ` Kevin Handy
2005-05-25 12:02     ` Bernardo Innocenti
2005-05-24  5:54 ` Zack Weinberg
2005-05-24  6:04   ` Daniel Jacobowitz
2005-05-24  6:22     ` Gabriel Dos Reis
2005-05-24  6:29     ` Zack Weinberg
2005-05-24  6:31       ` Mark Mitchell
2005-05-24  7:08         ` Zack Weinberg
2005-05-24  7:09           ` Mark Mitchell
2005-05-24  7:39           ` Gabriel Dos Reis [this message]
2005-05-24  8:48             ` Zack Weinberg
2005-05-24 13:41               ` Gabriel Dos Reis
2005-05-25  0:47             ` Russ Allbery
2005-05-25  1:24               ` Gabriel Dos Reis
2005-05-24 16:07       ` Paolo Bonzini
2005-05-24 16:44       ` Daniel Jacobowitz
2005-05-24 23:53         ` Zack Weinberg
2005-05-25  0:06           ` Daniel Jacobowitz
2005-05-25  0:11             ` Richard Henderson
2005-05-25  0:22             ` Zack Weinberg
2005-05-25  0:26           ` Paolo Carlini
2005-05-25  0:37             ` Zack Weinberg
2005-05-25  0:43               ` Daniel Jacobowitz
2005-05-25  0:48                 ` Zack Weinberg
2005-05-25  1:02                   ` Paolo Carlini
2005-05-25  3:14                   ` Daniel Jacobowitz
2005-05-25 13:30                     ` libstdc++ soname and versioning (was: Re: Compiling GCC...) Paolo Carlini
2005-05-25 13:45                       ` Theodore Papadopoulo
2005-05-25 13:53                         ` libstdc++ soname and versioning Paolo Carlini
2005-05-25 14:18                           ` Theodore Papadopoulo
2005-05-25 14:51                             ` Gabriel Dos Reis
2005-05-25 14:52                             ` Paolo Carlini
2005-05-25 13:54                         ` libstdc++ soname and versioning (was: Re: Compiling GCC...) Gabriel Dos Reis
2005-05-25 14:35                           ` Theodore Papadopoulo
2005-05-25 16:18                   ` Compiling GCC with g++: a report Jason Merrill
2005-05-25 12:44               ` Christoph Hellwig
2005-05-25 13:33                 ` Florian Weimer
2005-05-27  3:10                 ` Marcin Dalecki
2005-05-24  6:13   ` Andrew Pinski
2005-05-24  6:25     ` Gabriel Dos Reis
2005-05-27  4:04     ` Marcin Dalecki
2005-05-24  6:18   ` Gabriel Dos Reis
2005-05-24  6:43     ` Zack Weinberg
2005-05-24  7:04       ` Mark Mitchell
2005-05-24  8:00         ` Gabriel Dos Reis
2005-05-25  3:45         ` Kaveh R. Ghazi
2005-05-25  7:45           ` DJ Delorie
2005-05-25  8:36             ` Gabriel Dos Reis
2005-05-25 13:38             ` Kaveh R. Ghazi
2005-05-26 13:40               ` Gabriel Dos Reis
2005-05-24  7:38       ` Gabriel Dos Reis
2005-05-24  8:32         ` Zack Weinberg
2005-05-24 13:18           ` Gabriel Dos Reis
2005-05-24 23:45             ` Zack Weinberg
2005-05-25  0:29               ` Gabriel Dos Reis
2005-05-25  0:37                 ` Zack Weinberg
2005-05-25  0:52                   ` DJ Delorie
2005-05-25  0:55                     ` Zack Weinberg
2005-05-25  1:02                       ` Ian Lance Taylor
2005-05-25  1:36                       ` DJ Delorie
2005-05-25  1:40                         ` Zack Weinberg
2005-05-25  2:24                           ` Gabriel Dos Reis
2005-05-25 21:37                           ` hidden enum constants (Was: Compiling GCC with g++: a report) Giovanni Bajo
2005-05-25  1:50                         ` Compiling GCC with g++: a report Gabriel Dos Reis
2005-05-25  2:20                           ` DJ Delorie
2005-05-25  1:47                       ` Gabriel Dos Reis
2005-05-25  2:08                         ` DJ Delorie
2005-05-25  2:36                           ` Gabriel Dos Reis
2005-05-25  3:34                             ` DJ Delorie
2005-05-25  5:01                               ` Gabriel Dos Reis
2005-05-25  1:12                   ` Gabriel Dos Reis
2005-05-25  1:47                     ` DJ Delorie
2005-05-25  3:20                       ` Gabriel Dos Reis
2005-05-27  1:20           ` Marcin Dalecki
2005-05-24 17:17         ` Paul Koning
2005-05-24 17:25           ` Andreas Schwab
2005-05-24 20:43             ` Joe Buck
2005-05-24 21:40               ` Dale Johannesen
2005-05-24 17:49           ` Gabriel Dos Reis
2005-05-24  6:26   ` Mark Mitchell
2005-05-24  6:54     ` Zack Weinberg
2005-05-24  7:04       ` Mark Mitchell
2005-05-24 15:03         ` Kai Henningsen
2005-05-25  9:51         ` Jason Merrill
2005-05-24 10:01 ` Florian Weimer
2005-05-24 14:22   ` Gabriel Dos Reis
2005-05-24 18:00 ` Diego Novillo
2005-05-24 20:41   ` Richard Guenther
2005-05-24 23:14   ` Kevin Handy
2005-05-27  3:47   ` Marcin Dalecki
2005-05-27  1:20 ` Marcin Dalecki
2005-05-25  5:26 Paul Schlie
2005-05-25  6:10 ` DJ Delorie
2005-05-25 11:46   ` Paul Schlie
2005-05-25 18:31     ` DJ Delorie
2005-05-25 21:41       ` Paul Schlie
2005-05-26  6:11         ` DJ Delorie
2005-05-26  8:15           ` Paul Schlie
2005-05-26 11:57             ` DJ Delorie
2005-05-25 19:27 Richard Kenner

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=m31x7xjb13.fsf@uniton.integrable-solutions.net \
    --to=gdr@integrable-solutions.net \
    --cc=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=mark@codesourcery.com \
    --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).