Re: [PATCH 0/2] clean up some MAYBE_UNUSED cases
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2024, 20:46 UTC
- Message-ID
- <xmqq34mnukff.fsf@gitster.g>
- In-Reply-To
- <20240829200807.GA430283@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> - builtin/gc.c's check_crontab_process(). The whole function is marked
> as MAYBE_UNUSED here, which is a little funny. It's because
> is_crontab_available() may or may not call us based on __APPLE__.
> Should we conditionally define the function, too, in that case? It
> would mean repeating the #ifdef. Alternatively, we could define it
> like this:
>
> #ifdef __APPLE__
> static int check_crontab_process(const char *cmd UNUSED)
> {
> return 0;
> }
> #else
> static int check_crontab_process(const char *cmd UNUSED)
> {
> [...the real function...]
> }
> #endifOr inline the body of check_crontab_process() at its sole callsite (the other side of "#ifdef APPLE") in is_crontab_available() and get rid of check_crontab_process().
> But I think we're getting into "well, this is how I would have > written it" territory, and it doesn't matter much either way in > practice. It's probably better to just leave it alone.
OK.