git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] grep: prefer UNUSED to MAYBE_UNUSED for pcre allocators
Date: Fri, 30 Aug 2024 08:39:22 +0200	[thread overview]
Message-ID: <ZtFpGjBFlMNPnSld@tanuki> (raw)
In-Reply-To: <20240829200953.GB432235@coredump.intra.peff.net>

On Thu, Aug 29, 2024 at 04:09:53PM -0400, Jeff King wrote:
> We prove custom malloc/free callbacks for the pcre library to use. Those
> take an extra "data" parameter, but we don't use it. Back when these
> were added in 513f2b0bbd (grep: make PCRE2 aware of custom allocator,
> 2019-10-16), we only had MAYBE_UNUSED. But these days we have UNUSED,
> which we should prefer, as it will let the compiler inform us if the
> code changes to actually use the parameters.
> 
> I also moved the annotations to come after the variable name, which is
> how we typically spell it.
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Where "how we typically spell it" is "me", because I wrote 99% of the
> annotations we have. ;) I'm open to debate, but only if it is
> accompanied by a patch to change all of them to be consistent.

I don't care about the order, but if we settle on one I think we should
also document this accordingly in our code style guide.

In any case, the patch series looks obviously good, except for the one
typo that Eric already pointed out.

Thanks!

Patrick

  parent reply	other threads:[~2024-08-30  6:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 20:08 [PATCH 0/2] clean up some MAYBE_UNUSED cases Jeff King
2024-08-29 20:08 ` [PATCH 1/2] gc: drop MAYBE_UNUSED annotation from used parameter Jeff King
2024-08-29 20:09 ` [PATCH 2/2] grep: prefer UNUSED to MAYBE_UNUSED for pcre allocators Jeff King
2024-08-29 20:27   ` Eric Sunshine
2024-08-30  6:39   ` Patrick Steinhardt [this message]
2024-08-30 16:30     ` Junio C Hamano
2024-08-29 20:46 ` [PATCH 0/2] clean up some MAYBE_UNUSED cases 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZtFpGjBFlMNPnSld@tanuki \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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.
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 NNTP newsgroup(s).