Re: [PATCH 4/6] cli: intialize crypto structure in show and reply

Subject: Re: [PATCH 4/6] cli: intialize crypto structure in show and reply

Date: Thu, 17 May 2012 07:26:30 -0700

To: Jani Nikula, Notmuch Mail

Cc:

From: Jameson Graef Rollins


On Thu, May 17 2012, Jani Nikula <jani@nikula.org> wrote:
> On Thu, 17 May 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>> This makes sure it has proper initialization values when it's created.
>
> Please don't do this. It's unnecessary; if one field is initialized with
> a designated initializer, the rest are initialized to zero (or NULL).

It may be technically unnecessary, but why is that a reason to not do
it?  I intentionally did this to make it clear what the defaults are.
Otherwise the defaults are essentially undefined, which is not good.
Maybe the structure initializes to the correct defaults, but why count
on that when we can set them to the correct default, and have it clear
to readers of the code?

jamie.
part-000.sig (application/pgp-signature)

Thread: