This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Remove unnecessary zero-initializations


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]