git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Carlo Arenas <carenas@gmail.com>
To: Matheus Valadares <me@m28.io>
Cc: Johannes.Schindelin@gmx.de, derrickstolee@github.com,
	git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] setup: avoid uninitialized use of is_safe in ensure_valid_ownership
Date: Wed, 27 Apr 2022 01:31:59 -0700	[thread overview]
Message-ID: <CAPUEsphL6TARGuhjvCiXXt+CQZd1+c22KBw5n-XCvnP176yz8Q@mail.gmail.com> (raw)
In-Reply-To: <CA+zfrf-6c7BG-PDehHKh6_8zWdu=NeM9gL6zN8Ug+oT9fAOfqw@mail.gmail.com>

On Wed, Apr 27, 2022 at 1:17 AM Matheus Valadares <me@m28.io> wrote:
>
> That’s not needed. Fields in an aggregate constructor that are not named are initialized to 0.

Could you point me to the C99 specification that documents that if you
have it at hand?  Even if not strictly necessary, it seems like good
code higiene as its effect is hidden.

FWIW, it broke a change I was doing on top of this where I removed the
" .path " initializer to set it later and was suddenly getting random
unrelated errors because this field was not initialized.

Carlo

  parent reply	other threads:[~2022-04-27  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  8:04 [PATCH] setup: avoid uninitialized use of is_safe in ensure_valid_ownership Carlo Marcelo Arenas Belón
     [not found] ` <CA+zfrf-6c7BG-PDehHKh6_8zWdu=NeM9gL6zN8Ug+oT9fAOfqw@mail.gmail.com>
2022-04-27  8:31   ` Carlo Arenas [this message]
     [not found]     ` <CA+zfrf_mHfDXk-1VhU564YeCTW7rgDeeuORdTT61LkTESmC5Og@mail.gmail.com>
2022-04-27  9:16       ` Carlo Arenas
2022-04-27 14:04         ` Derrick Stolee
2022-04-27 16:35 ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPUEsphL6TARGuhjvCiXXt+CQZd1+c22KBw5n-XCvnP176yz8Q@mail.gmail.com \
    --to=carenas@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@m28.io \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).