[Bug libgcc/121397] [15/16 Regression] build fails in libgcc for aarch64-openbsd due to unused static function in enable-execute-stack-mprotect.c
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 6 09:31:24 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121397
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:a107b01da42b2f2303ffe53df5ea4a796f40597d
commit r16-3035-ga107b01da42b2f2303ffe53df5ea4a796f40597d
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Aug 6 11:30:48 2025 +0200
libgcc: Remove useless forward declaration [PR121397]
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.
2025-08-06 Jakub Jelinek <jakub@redhat.com>
PR libgcc/121397
* enable-execute-stack-mprotect.c (check_enabling): Remove useless
forward declaration.
More information about the Gcc-bugs
mailing list