public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Neumann <tneumann@users.sourceforge.net>
To: Andrew Pinski <pinskia@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] compiling gcc with a C++ compiler 4/n
Date: Tue, 15 May 2007 07:46:00 -0000	[thread overview]
Message-ID: <46496564.1070603@users.sourceforge.net> (raw)
In-Reply-To: <de8d50360705150030i2246f92cq2504957877cab4ee@mail.gmail.com>

Hi,

> I don't see why you are doing:
> -typedef struct eh_region *eh_region;
>
> +typedef struct eh_region_def * eh_region;
the old typedef created one eh_region type (a struct) in the struct
namespace, and a different eh_region type (a pointer to a struct) in the
global namespace. This is unfortunately not valid C++. So I had to
rename either the struct or the pointer to the struct.

I renamed the struct, as I thought the pointer would be the proper
outside representation (i.e. users of the exception handling logic do
not care about the struct). By looking at the code I think this is right
(forward declaration only plus typedef in header), only that most code
did not use the typedef to begin with... But of course I can rename the
typedef and keep the struct if you prefer.


> In fact, you the code worse to read as you used:
> #ifdef __GENGTYPE__
this is true, and indeed an ugly piece of code. Strictly speaking a
limitation of gengtype (as the proper typedef is in the header), but I
am open to suggestions to eliminate it. Unfortunately this does not seem
to be simple:

> why not change the typedef to be en_region_ptr instead?  It gets
> around the need for this hackery and the amount of changes you are
> doing.
Renaming the typedef does not solve the problem, I think. Of course you
will know better, but I thought the issue is that the typedef is on a
forward-declaration of a struct, which is then defined later. Perhaps I
misunderstood the gengtype output, though, I can try to the other way if
you think it works.


> Also by the way you need to list all the functions you are
> changing.  And say more of what you are doing in your changelog
> entries because right now they are lacking and not to what the coding
> style says they should be.
sorry for this, I only submit patches since a few days... Could you be a
bit more specific about what I should write? I interpreted the FSF
instructions such that:
- if a changes is all over the place (renaming a member e.g.) you just
write "func:c: What did I change"
- if it is indeed limited to a function you write "func.c (func): What
did I change in the func".

Or do you mean that "Cast as needed" etc. is too generic? I will write
as detailed descriptions as you like, but I thought that explaining the
reasons for obvious casts was not really helpful.


Thomas

  reply	other threads:[~2007-05-15  7:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15  7:19 Thomas Neumann
2007-05-15  7:30 ` Andrew Pinski
2007-05-15  7:46   ` Thomas Neumann [this message]
2007-05-15  8:05     ` Andrew Pinski
2007-05-15 10:39       ` Thomas Neumann
2007-05-19 13:33         ` Gerald Pfeifer
2007-05-15 11:50       ` Joseph S. Myers
2007-05-15 15:28         ` 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=46496564.1070603@users.sourceforge.net \
    --to=tneumann@users.sourceforge.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.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).