git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] setup: avoid uninitialized use of is_safe in ensure_valid_ownership

From
Carlo Arenas <carenas@gmail.com>
Date
Apr 27, 2022, 08:31 UTC
Message-ID
<CAPUEsphL6TARGuhjvCiXXt+CQZd1+c22KBw5n-XCvnP176yz8Q@mail.gmail.com>
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
Previous: Junio C HamanoNext: Carlo Arenas
Message 3 of 5 in “setup: avoid uninitialized use of is_safe in ensure_valid_ownership”
  1. setup: avoid uninitialized use of is_safe in ensure_valid_ownershipCarlo Marcelo Arenas Belón, Apr 27, 2022
  2. Junio C HamanoApr 27, 2022
  3. Carlo ArenasApr 27, 2022
  4. Carlo ArenasApr 27, 2022
  5. Derrick StoleeApr 27, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.