On Wed, Aug 28, 2024 at 02:28:47PM -0700, Junio C Hamano wrote: > By the way, Peff, do we have MAYBE_UNUSED that can be used in a case > like this one? Platforms without symbolic links supported may well > define NO_SYMLINK_HEAD, which makes the incoming parameters unused. Yes, it would be fine to use MAYBE_UNUSED in a case like this. The other option, and what I did for a conditional compilation in imap-send.c, is to just mention the variable like: /* mark as used to appease -Wunused-parameter with NO_SYMLINK_HEAD */ (void)lock; (void)target; In retrospect I think MAYBE_UNUSED is probably a little less magical, and I perhaps should have used it there. In this particular case, though, where there's no actual code in one half of the #ifdef, I think just defining two separate functions is cleaner. I.e., what you did with a macro below, though I'd probably have just used a real function with UNUSED markers. As an aside, I wonder if we should consider deprecating and eventually dropping support for core.prefersymlinkrefs. I can't think of a reason anybody would want to use it, and of course it makes no sense as we move on to alternate backends like reftables. I sent patches ages ago: https://lore.kernel.org/git/20151229060055.GA17047@xxxxxxxxxxxxxxxxxxxxx/ but I think it may have just gotten lost in the shuffle, and I've somehow been meaning to re-submit them for 9 years. :-/ -Peff