diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c index 43011452b7..a13020dc6d 100644 --- a/elf/ifuncmain9.c +++ b/elf/ifuncmain9.c @@ -22,6 +22,7 @@ # include # include +# include /* Do not use the test framework, so that the process setup is not disturbed. */ @@ -40,6 +41,8 @@ implementation (void) return random_constant; } +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); static __typeof__ (implementation) * inhibit_stack_protector resolver (void) @@ -49,6 +52,7 @@ resolver (void) } static int magic (void) __attribute__ ((ifunc ("resolver"))); +DIAG_POP_NEEDS_COMMENT_CLANG; int main (void) diff --git a/elf/tst-ifunc-fault-lazy.c b/elf/tst-ifunc-fault-lazy.c index 5157c6cc6c..04448b2b15 100644 --- a/elf/tst-ifunc-fault-lazy.c +++ b/elf/tst-ifunc-fault-lazy.c @@ -21,6 +21,7 @@ relocations. */ #include +#include #ifdef HAVE_GCC_IFUNC @@ -34,6 +35,8 @@ implementation (void) *p = 0; } +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); static __typeof__ (implementation) * resolver (void) { @@ -42,6 +45,7 @@ resolver (void) *p = 0; return implementation; } +DIAG_POP_NEEDS_COMMENT_CLANG; static void magic (void) __attribute__ ((ifunc ("resolver"))); diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 0635e0dff7..92b64c09f1 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -86,6 +86,7 @@ /* Obtain the definition of symbol_version_reference. */ #include +#include /* When PIC is defined and SHARED isn't defined, we are building PIE by default. */ @@ -685,7 +686,10 @@ for linking") # define __ifunc_args(type_name, name, expr, init, ...) \ extern __typeof (type_name) name __attribute__ \ ((ifunc (#name "_ifunc"))); \ - __ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__) + DIAG_PUSH_NEEDS_COMMENT_CLANG; \ + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wunused-function"); \ + __ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__); \ + DIAG_POP_NEEDS_COMMENT_CLANG; # define __ifunc_args_hidden(type_name, name, expr, init, ...) \ __ifunc_args (type_name, name, expr, init, __VA_ARGS__)