git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Stephen Boyd <bebarino@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] Fix sparse warnings
Date: Mon, 21 Mar 2011 09:12:36 -0700	[thread overview]
Message-ID: <7vsjugsb9n.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4D872420.8080501@viscovery.net> (Johannes Sixt's message of "Mon, 21 Mar 2011 11:10:40 +0100")

Johannes Sixt <j.sixt@viscovery.net> writes:

> Am 3/21/2011 10:45, schrieb Stephen Boyd:
>> diff --git a/daemon.c b/daemon.c
>> index 347fd0c..4c8346d 100644
>> --- a/daemon.c
>> +++ b/daemon.c
>> @@ -660,7 +660,7 @@ static void check_dead_children(void)
>>  static char **cld_argv;
>>  static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
>>  {
>> -	struct child_process cld = { 0 };
>> +	struct child_process cld = { NULL };
>
> IMO this change is not good.
>
> The purpose of { 0} is not to initialize (only) the first member, but
> rather to serve as a visual marker that says "We want the complete struct
> zero-initialized".

Huh?  News to me.

The first element of type const char ** is initialized to a NULL pointer
and the rest if filled with NUL bytes either way.

  parent reply	other threads:[~2011-03-21 16:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21  9:45 [PATCH 1/2] Makefile: Cover more files with make check Stephen Boyd
2011-03-21  9:45 ` [PATCH 2/2] Fix sparse warnings Stephen Boyd
2011-03-21 10:10   ` Johannes Sixt
2011-03-21 10:12     ` Stephen Boyd
2011-03-21 16:12     ` Junio C Hamano [this message]
2011-03-21 16:15   ` Junio C Hamano
2011-03-21 18:01     ` [PATCHv2 " Stephen Boyd
2011-03-21 19:29       ` Junio C Hamano
2011-03-21 21:58         ` Junio C Hamano
2011-03-21 22:04           ` Stephen Boyd
2011-03-22  7:51         ` [PATCHv3 " Stephen Boyd
2011-03-22 17:18           ` Junio C Hamano
2011-03-21 17:27 ` [PATCH 1/2] Makefile: Cover more files with make check Junio C Hamano

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=7vsjugsb9n.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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;
as well as URLs for NNTP newsgroup(s).