bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: io.c incompatible pointer between public.read_func and ssize_t(*)()


From: arnold
Subject: Re: io.c incompatible pointer between public.read_func and ssize_t(*)() with c23
Date: Sat, 10 Aug 2024 21:56:30 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Jeffrey Cliff <jeffrey.cliff@gmail.com> wrote:

> if i'm reading https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm
> correctly i don't think it's what the return value of read is, so much
> as what its function prototype resolves to during the cast -- ie
> ssize_t*() is a different function type than read(int , void* , size_t
> ) is (and this changes in c23)  when read_func is declared it is
> explicitly declared as having the same datatype as read() ie
>
>         ssize_t (*read_func)(int, void *, size_t);
>
> so read_func already is the right datatype and doesn't need further
> modification, and 'read' doesn't seem to need a wrapper - it's the
> middle step ( casting to an {empty in c23, whatever is sent in in
> pre-c23} parameter ssize_t function ) where things go wrong.

I think the attached patch does the trick. I'm a little loath to
remove the casts entirely.

Let me know.

Thanks,

Arnold

Attachment: DIFF
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]