From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
Date: Sun, 07 Sep 2025 21:17:33 -0700 [thread overview]
Message-ID: <xmqqh5xdzig2.fsf@gitster.g> (raw)
In-Reply-To: <81d10b44-5b3a-42af-acf4-ae76f2fee298@web.de> ("René Scharfe"'s message of "Sun, 7 Sep 2025 18:22:18 +0200")
René Scharfe <l.s.r@web.de> 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.
prev parent reply other threads:[~2025-09-08 4:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 17:58 [PATCH] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter René Scharfe
2025-09-04 20:09 ` Junio C Hamano
2025-09-07 16:22 ` René Scharfe
2025-09-08 4:17 ` Junio C Hamano [this message]
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=xmqqh5xdzig2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=l.s.r@web.de \
/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).