On Wed, 6 Aug 2025, Jakub Jelinek wrote:
> Hi!
>
> aarch64 for some strange reason unconditionally enables -Werror for libgcc
> building and this particular file for some strange reason contains
> a useless static forward declaration of a function only defined in the
> #if defined __sun__ && defined __svr4__
> block and not otherwise (with __attribute__((constructor))).
> And we warn (with -Werror error) in the non-__sun__/__svr4__ case because
> it declares a static function that is never defined.
> The forward declaration makes no sense to me, for static functions
> forward declarations shouldn't be needed even for -Wstrict-prototypes,
> and AFAIK we don't warn on static __attribute__((constructor)) void foo
> (void) {}
> being unused. And the function isn't used before being defined.
>
> So, the following patch just removes the forward declaration.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK.
Richard.
> 2025-08-06 Jakub Jelinek <[email protected]>
>
> PR libgcc/121397
> * enable-execute-stack-mprotect.c (check_enabling): Remove useless
> forward declaration.
>
> --- libgcc/enable-execute-stack-mprotect.c.jj 2025-04-08 14:09:53.630413475
> +0200
> +++ libgcc/enable-execute-stack-mprotect.c 2025-08-05 19:21:26.780914701
> +0200
> @@ -30,7 +30,6 @@
>
> static int need_enable_exec_stack;
>
> -static void check_enabling (void) __attribute__ ((unused));
> extern void __enable_execute_stack (void *);
>
> #if defined __sun__ && defined __svr4__
>
> Jakub
>
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)