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 12:07:37 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thanks for the report. I recommend not using -std=gnu23. I have to
support many older compilers, so gawk purposely is not expected
to follow the latest standards.

Thanks,

Arnold

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

> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnm
> Compiler: gcc (GCC) 15.0.0 20240509 (experimental)
> Compilation CFLAGS: -std=gnu23 -DNDEBUG
> uname output: Linux fatima 6.10.3-gnu-c23-qxfixgnm #2 SMP
> PREEMPT_DYNAMIC Wed Aug  7 20:46:44 CST 2024 x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Gawk Version: 5.3.0*
>
> Attestation 1:
>         I have read
> https://www.gnu.org/software/gawk/manual/html_node/Bugs.html.
>         Yes
>
> Attestation 2:
>         I have not modified the sources before building gawk.
>         True
>
> Description:
>
> compilation fails at io.c:
>
>         # gcc -DDEFPATH='".:/usr/local/share/awk"'
> -DDEFLIBPATH="\"/usr/local/lib/gawk\"" -DSHLIBEXT="\"so"\"
> -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR='"/usr/local/share/locale"'
> -I"./support" -I.    -std=gnu23  -DND\
> EBUG -std=gnu23  -DNDEBUG -MT io.o -MD -MP -MF $depbase.Tpo -c -o io.o io.c 
> &&\
>         mv -f $depbase.Tpo $depbase.Po
>         io.c: In function 'iop_alloc':
>         io.c:3389:31: error: assignment to 'ssize_t (*)(int,  void *,
> size_t)' {aka 'long int (*)(int,  void *, long unsigned int)'} from
> incompatible pointer type 'ssize_t (*)(void)' {aka 'long int
> (*)(void)'}\
>  [-Wincompatible-pointer-types]
>          3389 |         iop->public.read_func = ( ssize_t(*)() ) read;
>                |                               ^
>                io.c: In function 'get_read_timeout':
>                io.c:4449:36: warning: comparison of distinct pointer
> types lacks a cast [-Wcompare-distinct-pointer-types]
>                 4449 |         if ((iop->public.read_func == (
> ssize_t(*)() ) read) && tmout > 0)
>                       |                                    ^~
>
> Repeat-By:
>         setting CFLAGS to -std=gnu23 on gcc new enough to support it
>
> ( installed gawk is 5.2.2 trying to upgrade to 5.3.0 )



reply via email to

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