Message ID | 20240829200807.GA430283@coredump.intra.peff.net (mailing list archive) |
---|---|
Headers | show |
Series | clean up some MAYBE_UNUSED cases | expand |
Jeff King <peff@peff.net> writes: > - 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...] > } > #endif Or 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.