Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: function pointer question
Date: Wed, 07 Jan 2026 07:35:17 -0800
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <86bjj5phai.fsf@linuxsc.com>
References: <10j7rs6$7c9e$1@dont-email.me> <20260102091518.226@kylheku.com> <10j96mn$jrsp$1@dont-email.me> <10j9enb$p6ts$2@dont-email.me> <10j9g71$pr9o$1@dont-email.me> <10jb3j5$17gcb$3@dont-email.me> <10jbsp0$1gf7e$1@dont-email.me> <10jc02j$1hk1n$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 07 Jan 2026 15:35:20 +0000 (UTC)
Injection-Info: dont-email.me; posting-host="96c89593a79aadfcc4daf354c711affa"; logging-data="798811"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gNiLQtdvn8U40znv1wiHmfk8Sjhk8vrI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:YG6vqZ43wvdwNbCo48fQpCsC0pw= sha1:pGNiYs9jSskaG50e19YEPIjkA8w=
Xref: csiph.com comp.lang.c:396265
Andrey Tarasevich writes:
> On Sat 1/3/2026 12:04 PM, Chris M. Thomasson wrote:
>
>> struct object_prv_vtable {
>> int (*fp_destroy) (void* const);
>> };
>
> And interesting piece of trivia about C function types and function
> type compatibility rules is that:
>
> 1. Top-level qualifiers on function parameters are preserved as part
> of function type.
Not completely wrong but not exactly right either.
> However, such top-level qualifiers are ignored when
> determining function type compatibility.
It's easier to take the point of view that top-level qualifiers
for function parameters don't participate in the type of the
function as a whole. Taking that view is easier to understand
and gives results that are indistinguishable from the actual
rules.