https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89340
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- It should be actually rejected like: __attribute__((weak)) static void foo () {} void bar (void) { foo (); } pr89340.c:1:35: error: weak declaration of ‘foo’ must be public 1 | __attribute__((weak)) static void foo () {} | ^~~