git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH 1/4] mailmap: drop debugging code
Date: Fri, 17 Mar 2023 16:08:43 -0400	[thread overview]
Message-ID: <CAPig+cQ9MNjEFHA07CM+c+qfTzNm99D=npLPD9qY079kkCzH6g@mail.gmail.com> (raw)
In-Reply-To: <ZBS8illla36MVppa@coredump.intra.peff.net>

On Fri, Mar 17, 2023 at 3:16 PM Jeff King <peff@peff.net> wrote:
> 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/

> 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.

  reply	other threads:[~2023-03-17 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 19:13 [PATCH 0/4] more unused-parameter fixes Jeff King
2023-03-17 19:16 ` [PATCH 1/4] mailmap: drop debugging code Jeff King
2023-03-17 20:08   ` Eric Sunshine [this message]
2023-03-17 21:13     ` Jeff King
2023-03-17 19:16 ` [PATCH 2/4] http: drop unused parameter from start_object_request() Jeff King
2023-03-17 19:17 ` [PATCH 3/4] http: mark unused parameter in fill_active_slot() callbacks Jeff King
2023-03-17 19:17 ` [PATCH 4/4] transport: mark unused parameters in fetch_refs_from_bundle() Jeff King
2023-03-17 20:28   ` 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='CAPig+cQ9MNjEFHA07CM+c+qfTzNm99D=npLPD9qY079kkCzH6g@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).