From c2d8f0b704c2b828bcd8d517a2376c0240c73c09 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 6 Feb 2019 17:16:43 +0000 Subject: Avoid "inline" after return type in function definitions. One group of warnings seen with -Wextra is warnings for static or inline not at the start of a declaration (-Wold-style-declaration). This patch fixes various such cases for inline, ensuring it comes at the start of the declaration (after any static). A common case of the fix is "static inline __always_inline"; the definition of __always_inline starts with __inline, so the natural change is to "static __always_inline ". Other cases of the warning may be harder to fix (one pattern is a function definition that gets rewritten to be static by an including file, "#define funcname static wrapped_funcname" or similar), but it seems worth fixing these cases with inline anyway. Tested for x86_64. * elf/dl-load.h (_dl_postprocess_loadcmd): Use __always_inline before return type, without separate inline. * elf/dl-tunables.c (maybe_enable_malloc_check): Likewise. * elf/dl-tunables.h (tunable_is_name): Likewise. * malloc/malloc.c (do_set_trim_threshold): Likewise. (do_set_top_pad): Likewise. (do_set_mmap_threshold): Likewise. (do_set_mmaps_max): Likewise. (do_set_mallopt_check): Likewise. (do_set_perturb_byte): Likewise. (do_set_arena_test): Likewise. (do_set_arena_max): Likewise. (do_set_tcache_max): Likewise. (do_set_tcache_count): Likewise. (do_set_tcache_unsorted_limit): Likewise. * nis/nis_subr.c (count_dots): Likewise. * nptl/allocatestack.c (advise_stack_range): Likewise. * sysdeps/ieee754/dbl-64/s_sin.c (do_cos): Likewise. (do_sin): Likewise. (reduce_sincos): Likewise. (do_sincos): Likewise. * sysdeps/unix/sysv/linux/x86/elision-conf.c (do_set_elision_enable): Likewise. (TUNABLE_CALLBACK_FNDECL): Likewise. --- nis/nis_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nis') diff --git a/nis/nis_subr.c b/nis/nis_subr.c index 299fa27..88a5e3c 100644 --- a/nis/nis_subr.c +++ b/nis/nis_subr.c @@ -91,7 +91,7 @@ nis_name_of_r (const_nis_name name, char *buffer, size_t buflen) } libnsl_hidden_nolink_def (nis_name_of_r, GLIBC_2_1) -static int __always_inline +static __always_inline int count_dots (const_nis_name str) { int count = 0; -- cgit v1.1