about summary refs log tree commit diff
path: root/elf/dl-load.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2019-02-06 17:16:43 +0000
committerJoseph Myers <joseph@codesourcery.com>2019-02-06 17:16:43 +0000
commitc2d8f0b704c2b828bcd8d517a2376c0240c73c09 (patch)
treef60739031829eefd27fb10d61369617efa79f515 /elf/dl-load.h
parent3b935595859e0232b74594c5aca6da88a31f90b3 (diff)
downloadglibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.tar.gz
glibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.tar.xz
glibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.zip
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 <type> __always_inline"; the definition of
__always_inline starts with __inline, so the natural change is to
"static __always_inline <type>".  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.
Diffstat (limited to 'elf/dl-load.h')
-rw-r--r--elf/dl-load.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/elf/dl-load.h b/elf/dl-load.h
index 22954c1807..dddbcb8575 100644
--- a/elf/dl-load.h
+++ b/elf/dl-load.h
@@ -83,7 +83,7 @@ struct loadcmd
 /* This is a subroutine of _dl_map_segments.  It should be called for each
    load command, some time after L->l_addr has been set correctly.  It is
    responsible for setting up the l_text_end and l_phdr fields.  */
-static void __always_inline
+static __always_inline void
 _dl_postprocess_loadcmd (struct link_map *l, const ElfW(Ehdr) *header,
                          const struct loadcmd *c)
 {