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

Jameson Graef Rollins jrollins at finestructure.net
Thu May 17 07:26:30 PDT 2012


On Thu, May 17 2012, Jani Nikula <jani at nikula.org> wrote:
> On Thu, 17 May 2012, Jameson Graef Rollins <jrollins at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120517/a329ef95/attachment.pgp>


More information about the notmuch mailing list