diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-05-16 09:23:52 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-05-16 09:32:31 -0700 |
commit | 5e22aee79f9d02ac37f40f1d18f5696114c3c3c9 (patch) | |
tree | 4aaf6260ac32cc633d0513dbf58b396ca8c9ad99 /lib/vasnprintf.c | |
parent | 0414a24cf57f1569b0b4f2a0f22898a0943dfc14 (diff) | |
download | gnulib-5e22aee79f9d02ac37f40f1d18f5696114c3c3c9.tar.gz |
manywarnings: update for GCC 7
* build-aux/gcc-warning.spec:
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which
requires a non-comment fallthrough attribute. This is a bit
cleaner than the comment versions.
* lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c:
* lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro.
Use it whenever one switch case falls through into the next.
Diffstat (limited to 'lib/vasnprintf.c')
-rw-r--r-- | lib/vasnprintf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 839f79060b..9c2af0e45e 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -118,6 +118,14 @@ # include "fpucw.h" #endif +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + /* Default parameters. */ #ifndef VASNPRINTF # if WIDE_CHAR_VERSION @@ -4837,7 +4845,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *fbp++ = 'l'; # endif #endif - /*FALLTHROUGH*/ + FALLTHROUGH; case TYPE_LONGINT: case TYPE_ULONGINT: #if HAVE_WINT_T |