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

Re: What's cooking in git.git (Dec 2012, #05; Tue, 18)

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 20, 2012, 20:26 UTC
Message-ID
<7vfw304gic.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20121220195837.GB21785@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> So our attempt for more compile-time safety may actually introduce a
> run-time bug.  And it is a hard bug to find, as the preprocessor
> "magically" converts the error code into -1 without you being able to
> see it in the code.
>
> It would be safer to just unconditionally use the macros and drop the
> return values from the functions entirely, like the patch below
> (squashed on top of what is in jk/error-const-return). But it cannot
> work for error(), because the variadic nature means we need to restrict
> ourselves to __GNUC__.

While I like the general direction, I am not sure if we are OK with the introduction of

Show 7 quoted lines
>  #undef config_error_nonbool
> -int config_error_nonbool(const char *var)
> +void config_error_nonbool(const char *var)
>  {
> -	return error("Missing value for '%s'", var);
> +	error("Missing value for '%s'", var);
>  }

a new, arguably false, "returned value not used" warning from this point. Perhaps it is fine for now, as we have tons of calls that do not cast the return value to "(void)".

Previous: Jeff King
Message 6 of 6 in “What's cooking in git.git (Dec 2012, #05; Tue, 18)”
  1. Junio C HamanoDec 18, 2012
  2. Junio C HamanoDec 19, 2012
  3. Jeff KingDec 20, 2012
  4. Junio C HamanoDec 20, 2012
  5. Jeff KingDec 20, 2012
  6. Junio C HamanoDec 20, 2012

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.