From: Junio C Hamano Date: Mon, 08 Sep 2025 04:17:33 GMT Subject: Re: [PATCH] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter Message-ID: In-Reply-To: <81d10b44-5b3a-42af-acf4-ae76f2fee298@web.de> René Scharfe writes: > I can see the appeal, even though (or because) it's kinda half a step > back as it keeps the original local variable, in a better place. > > We could _lunge_ forward and add type checks to allow the compiler to > tell us whether the pointers' journey through the void is safe. The > trick below is simple enough, but requires bespoke macros AFAICS. Once there is even a single step of callback interface where the callback parameter has to be a generic "void *", we have to cast down to the concrete "struct min_abbrev_data *" either explicitly or implicitly anyway, so it does not really make that much of a difference (and that is why I said "we obviously do not have to"). Thanks.