bug-bash
[Top][All Lists]
Advanced

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

Re: fpurge implicit declaration error glibc 2.41


From: Grisha Levit
Subject: Re: fpurge implicit declaration error glibc 2.41
Date: Thu, 13 Nov 2025 16:38:24 -0500

On Thu, Nov 13, 2025, 16:32 Emanuele Torre <torreemanuele6@gmail.com> wrote:

> The 81d85842687 commit from 2025-11-13 introduced an fpurge (stdout) in
> sig.c
>
> When compiling using:
>     $ gcc --version|sed q
>     gcc (Gentoo 14.3.1_p20250801 p4) 14.3.1 20250801
>     $ /usr/lib/ld-linux.so.2 --version|sed q
>     ld.so (Gentoo 2.41-r6 (patchset 8)) stable release version 2.41.
>
> I get the following error:
>     ../sig.c: In function ‘throw_to_top_level’:
>     ../sig.c:467:5: error: implicit declaration of function ‘fpurge’
> [-Wimplicit-function-declaration]
>       467 |     fpurge (stdout);
>           |     ^~~~~~
>
> Reading the fpurge(3) man page I see
>     SYNOPSIS
>            /* unsupported */
>            #include <stdio.h>
>
>            int fpurge(FILE *stream);
>
>            /* supported */
>            #include <stdio.h>
>            #include <stdio_ext.h>
>
>            void  __fpurge(FILE *stream);
>
> Suggesting that glibc does not suport fpurge(), only __fpurge that is
> defined in the stdio_ext.h header.
>
> o/
>  emanuele6



The fix is to add #define NEED_FPURGE_DECL before including shell.h in
sig.c.
I'm not sure why, but the declaration in externs.h is guarded by both
NEED_FPURGE_DECL and !HAVE_DECL_FPURGE.


reply via email to

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