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

Re: [PATCH 1/4] mailmap: drop debugging code

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 17, 2023, 20:08 UTC
Message-ID
<CAPig+cQ9MNjEFHA07CM+c+qfTzNm99D=npLPD9qY079kkCzH6g@mail.gmail.com>
In-Reply-To
<ZBS8illla36MVppa@coredump.intra.peff.net>
On Fri, Mar 17, 2023 at 3:16 PM Jeff King <peff@peff.net> wrote:
Show 32 quoted lines
> There's some debugging code in mailmap.c which is only compiled if you
> manually tweak the source to set DEBUG_MAILMAP. When it's not set, the
> fallback noop uses static inline functions; we couldn't use macros here
> because one of the functions is variadic (and variadic macros were
> forbidden back then, but aren't now). As a result, this triggers
> a -Wunused-parameter warning.
>
> We have a few options here:
>
>   1. Leave it be. Just mark it as UNUSED, or switch to a variadic macro.
>
>   2. Assume the debugging code is useful, compile it always, and trigger
>      it with a run-time flag (e.g., with a trace key). This is pretty
>      easy to do, and carries a pretty small runtime cost.
>
>   3. Assume the debugging is not very useful, and just rip it out. This
>      matches what we did with a similar case in 69c5f17f11 (attr: drop
>      DEBUG_ATTR code, 2022-10-06).
>
> The debugging flag has been mentioned only three times on the list.
> Once, when it was added in 2009:
>
>   https://lore.kernel.org/git/cover.1234102794.git.marius@trolltech.com/
>
> In 2013, when somebody fixed some compilation errors in the conditional
> code (presumably because they used it while making other changes):
>
>   https://lore.kernel.org/git/1373871253-96480-1-git-send-email-sunshine@sunshineco.com/
>
> And finally it seemed to have been useful to somebody in 2021:
>
>   https://lore.kernel.org/git/87eejswql6.fsf@evledraar.gmail.com/
Nit: s/2021/2020/
Show 15 quoted lines
> So it's not totally without value. On the other hand, it's not likely to
> be useful to non-developers (and certainly isn't if you have to
> recompile). And using a debugger or adding your own inspection code is
> likely to be as useful. So I've just dropped the code entirely here.
>
> Note that we do still have to mark a few parameters unused in callback
> functions which are passed to string_list_clear_func(). Those get an
> extra pointer with the string being cleared, which we previously fed to
> the debugging code.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I'm cc-ing folks from those earlier threads. If somebody really wants to
> salvage it, I can prepare a patch converting it to a trace variable
> instead, but absent any outcry, I'd go with this approach.
As one of the mentioned anonymous "sombody"s, I have no objection.
Previous: Jeff KingNext: Jeff King
Message 3 of 8 in “more unused-parameter fixes”
  1. 0/4 more unused-parameter fixesJeff King, Mar 17, 2023
  2. 1/4 mailmap: drop debugging codeJeff King, Mar 17, 2023
  3. Eric SunshineMar 17, 2023
  4. Jeff KingMar 17, 2023
  5. 2/4 http: drop unused parameter from start_object_request()Jeff King, Mar 17, 2023
  6. 3/4 http: mark unused parameter in fill_active_slot() callbacksJeff King, Mar 17, 2023
  7. 4/4 transport: mark unused parameters in fetch_refs_from_bundle()Jeff King, Mar 17, 2023
  8. Junio C HamanoMar 17, 2023

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.