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: Jeffrey Cliff
Subject: Re: io.c incompatible pointer between public.read_func and ssize_t(*)() with c23
Date: Sat, 10 Aug 2024 15:01:43 -0600

> I don't know what you mean by that.

I meant the commit at
https://git.savannah.gnu.org/cgit/gawk.git/commit/?id=c190576fd345d9c098901061f0fd4164a7bfc87f

and must have misread 'master' as 'main' in my head, apologies, that
wasn't accurate on my part

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.



On Sat, Aug 10, 2024 at 1:12 PM <arnold@skeeve.com> wrote:
>
> Jeffrey Cliff <jeffrey.cliff@gmail.com> wrote:
>
> > Of course.
> >
> > * this also occurs on main / c190576f
>
> I don't know what you mean by that.
>
> Looking at this some more, I may try removing that cast
> and updating the type of read_func in the struct.
>
> Thanks,
>
> Arnold



-- 
------------------------------------------------------------------------------------------------
End the campaign to Cancel Richard Stallman - go to stallmansupport.org !
------------------------------------------------------------------------------------------------



reply via email to

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