Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <shebs@apple.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: Felix Lee <bdgle@tigerfood.org>, gdb-patches@sources.redhat.com
Subject: Re: PATCH: Remove unnecessary zero-initializations
Date: Wed, 13 Nov 2002 11:38:00 -0000	[thread overview]
Message-ID: <3DD2A9EC.3010201@apple.com> (raw)
In-Reply-To: <3DD2A230.5A2935EC@redhat.com>

Michael Snyder wrote:

>Felix Lee wrote:
>
>>Daniel Jacobowitz <drow@mvista.com>:
>>
>>>Certainly it's a style issue.  However, it's an awkward style issue and
>>>anyone implementing a target should be looking over the complete list
>>>of methods anyway.
>>>
>>Of course.  It's not about writing the target in the first
>>place, it's about reading it and maintaining it later.  Say,
>>a year from now, someone adds a new method but doesn't spend
>>all the effort necessary to make all N targets work
>>correctly with the change, which is reasonable since it's
>>not sensible to insist that everyone be familiar with the
>>issues of all N targets before doing any work.
>>
>>Absence of an initializer is a simple indication that
>>someone should look at it and make sure it's ok. 
>>
>
>No.  New target methods need to be optional, else someone
>will be required to go back and implement them for all old targets.
>The fact that they don't need to be initialized to zero is intentional, 
>so that a new method does not require any modification to old targets.
>If there is no initialization, and indeed no mention of the new 
>method at all in an old target module, you can safely conclude
>that the module doesn't implement the method.
>
That's right.  The goal was to make it follow an object-oriented style,
where when you instantiate something, you only fill in the elements
that don't have a default value.

While there's something to be said for the opposite style, on
the theory that it means you have to consider whether to implement
each method, it breaks down when the superclass (aka target
vector struct) changes, because you then have to go and modify
all the instances, including those for targets that you don't have
access to (and *nobody* has h/w for all the targets supported by
GDB!), so you're in the undesirable situation of modifying code
that you can't test.

Stan

>


  reply	other threads:[~2002-11-13 19:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-10 16:18 Daniel Jacobowitz
2002-11-10 20:09 ` Andrew Cagney
2002-11-10 20:22   ` Daniel Jacobowitz
2002-12-19 15:51     ` Elena Zannoni
2002-12-19 15:59       ` Daniel Jacobowitz
2002-11-11  6:39   ` Elena Zannoni
2002-11-13 10:59   ` Michael Snyder
2002-11-13 11:32     ` Andrew Cagney
2002-11-13 11:50       ` Michael Snyder
2002-11-11  2:48 ` Felix Lee
2002-11-11  6:33   ` Daniel Jacobowitz
2002-11-11 17:15     ` Felix Lee
2002-11-12 13:44       ` Daniel Jacobowitz
2002-11-13 11:04       ` Michael Snyder
2002-11-13 11:38         ` Stan Shebs [this message]
2002-11-13 11:01   ` Michael Snyder

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=3DD2A9EC.3010201@apple.com \
    --to=shebs@apple.com \
    --cc=bdgle@tigerfood.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.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