diff options
author | Joseph Myers <joseph@codesourcery.com> | 2019-02-06 17:16:43 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2019-02-06 17:16:43 +0000 |
commit | c2d8f0b704c2b828bcd8d517a2376c0240c73c09 (patch) | |
tree | f60739031829eefd27fb10d61369617efa79f515 /sysdeps | |
parent | 3b935595859e0232b74594c5aca6da88a31f90b3 (diff) | |
download | glibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.zip glibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.tar.gz glibc-c2d8f0b704c2b828bcd8d517a2376c0240c73c09.tar.bz2 |
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 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/dbl-64/s_sin.c | 12 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86/elision-conf.c | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c index 7584afc..26799f1 100644 --- a/sysdeps/ieee754/dbl-64/s_sin.c +++ b/sysdeps/ieee754/dbl-64/s_sin.c @@ -97,8 +97,7 @@ int __branred (double x, double *a, double *aa); of the number by combining the sin and cos of X (as computed by a variation of the Taylor series) with the values looked up from the sin/cos table to get the result. */ -static inline double -__always_inline +static __always_inline double do_cos (double x, double dx) { mynumber u; @@ -122,8 +121,7 @@ do_cos (double x, double dx) the number by combining the sin and cos of X (as computed by a variation of the Taylor series) with the values looked up from the sin/cos table to get the result. */ -static inline double -__always_inline +static __always_inline double do_sin (double x, double dx) { double xold = x; @@ -151,8 +149,7 @@ do_sin (double x, double dx) is written to *a, the low part to *da. Range reduction is accurate to 136 bits so that when x is large and *a very close to zero, all 53 bits of *a are correct. */ -static inline int4 -__always_inline +static __always_inline int4 reduce_sincos (double x, double *a, double *da) { mynumber v; @@ -178,8 +175,7 @@ reduce_sincos (double x, double *a, double *da) } /* Compute sin or cos (A + DA) for the given quadrant N. */ -static double -__always_inline +static __always_inline double do_sincos (double a, double da, int4 n) { double retval; diff --git a/sysdeps/unix/sysv/linux/x86/elision-conf.c b/sysdeps/unix/sysv/linux/x86/elision-conf.c index 56cdc6d..6ba93da 100644 --- a/sysdeps/unix/sysv/linux/x86/elision-conf.c +++ b/sysdeps/unix/sysv/linux/x86/elision-conf.c @@ -56,8 +56,7 @@ struct elision_config __elision_aconf = int __pthread_force_elision attribute_hidden = 0; #if HAVE_TUNABLES -static inline void -__always_inline +static __always_inline void do_set_elision_enable (int32_t elision_enable) { /* Enable elision if it's avaliable in hardware. It's not necessary to check @@ -79,8 +78,7 @@ TUNABLE_CALLBACK (set_elision_enable) (tunable_val_t *valp) } #define TUNABLE_CALLBACK_FNDECL(__name, __type) \ -static inline void \ -__always_inline \ +static __always_inline void \ do_set_elision_ ## __name (__type value) \ { \ __elision_aconf.__name = value; \ |