This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Remove unnecessary zero-initializations
- From: Michael Snyder <msnyder at redhat dot com>
- To: Felix Lee <bdgle at tigerfood dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 13 Nov 2002 11:01:17 -0800
- Subject: Re: PATCH: Remove unnecessary zero-initializations
- Organization: Red Hat, Inc.
- References: <200211111048.gABAmXr01641@paper-wolf-solo.tigerfood.org>
Felix Lee wrote:
>
> Daniel Jacobowitz <drow@mvista.com>:
> > Currently, thirteen files which provide a target_ops explicitly initialize
> > members they don't support to NULL.
>
> this is a style and readability issue. if every set of
> initializations is complete and mentions all members, even
> when "unnecessary", then it's easier to quickly check that
> an implementation correctly matches the specification. a
> statement like
> foo.bar = 0;
> indicates that the programmer was aware that foo.bar exists,
> thought about it, and decided that 0 is a correct value.
This is counter to the intention. We made the initializations
un-necessary on purpose, so that when a new target method gets
added, you don't have to go add a new " = NULL;" to every file
that doesn't implement it.