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

nonnull v.s. BUG() if !x (was: [PATCH v2] config.c: NULL check when reading protected config)

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 27, 2022, 09:12 UTC
Message-ID
<220727.86v8rilxx1.gmgdl@evledraar.gmail.com>
In-Reply-To
<pull.1299.v2.git.git.1658874067077.gitgitgadget@gmail.com>
On Tue, Jul 26 2022, Glen Choo via GitGitGadget wrote:
> From: Glen Choo <chooglen@google.com>
> +	if (!filename)
> +		BUG("filename cannot be NULL");

Looks good, but as an aside I wonder if we wouldn't get better code analysis with "nonnull" for this sort of thing, but we can leave this for now: https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes

Previous: Glen Choo via GitGitGadgetNext: Glen Choo
Message 11 of 14 in “config.c: NULL check when reading protected config”
  1. config.c: NULL check when reading protected configGlen Choo via GitGitGadget, Jul 26, 2022
  2. Taylor BlauJul 26, 2022
  3. Glen ChooJul 26, 2022
  4. Taylor BlauJul 26, 2022
  5. Derrick StoleeJul 26, 2022
  6. Glen ChooJul 26, 2022
  7. Ævar Arnfjörð BjarmasonJul 26, 2022
  8. Glen ChooJul 26, 2022
  9. Ævar Arnfjörð BjarmasonJul 27, 2022
  10. config.c: NULL check when reading protected configGlen Choo via GitGitGadget, Jul 26, 2022
  11. nonnull v.s. BUG() if !x (was: [PATCH v2] config.c: NULL check when reading protected config)Ævar Arnfjörð Bjarmason, Jul 27, 2022
  12. Glen ChooJul 27, 2022
  13. Junio C HamanoJul 27, 2022
  14. Glen ChooJul 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.