On Sun, Oct 22, 2023 at 12:47 AM Florian Weimer <fwei...@redhat.com> wrote:
>
> Current glibc headers only declare fputs_unlocked for _GNU_SOURCE.
> Defining the macro avoids an implicit function declaration.

This does not help targets that don't use glibc though.
Note for builtins testsuite there is a lib-fputs.c file which will
define a fputs_unlock which is how it will link even if the libc does
not define a fputs_unlock.

Thanks,
Andrew Pinski

>
> gcc/testsuite/
>
>         * gcc.c-torture/execute/builtins/fputs.c (_GNU_SOURCE):
>         Define.
>
> ---
>  gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c 
> b/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c
> index 93fa9736449..13e30724355 100644
> --- a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c
> +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c
> @@ -5,6 +5,7 @@
>
>     Written by Kaveh R. Ghazi, 10/30/2000.  */
>
> +#define _GNU_SOURCE /* For fputs_unlocked.  */
>  #include <stdio.h>
>  extern void abort(void);
>
>

Reply via email to