Merge pull request #7389 from shawnl/warning

tree-wide: adjust fall through comments so that gcc is happy
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-11-22 07:38:51 +01:00
committed by GitHub
44 changed files with 106 additions and 71 deletions
+4
View File
@@ -15,6 +15,10 @@
#include "MurmurHash2.h"
#if __GNUC__ >= 7
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#endif
//-----------------------------------------------------------------------------
// Platform-specific functions and macros
+6
View File
@@ -7,6 +7,12 @@ import sys
name, prefix, input = sys.argv[1:]
print("""\
%{
#if __GNUC__ >= 7
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
#endif
%}""")
print("""\
struct {}_name {{ const char* name; int id; }};
%null-strings
+1
View File
@@ -48,6 +48,7 @@
#define _weakref_(x) __attribute__((weakref(#x)))
#define _alignas_(x) __attribute__((aligned(__alignof(x))))
#define _cleanup_(x) __attribute__((cleanup(x)))
#define _fallthrough_ __attribute__((fallthrough))
/* Temporarily disable some warnings */
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
+7 -7
View File
@@ -127,25 +127,25 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
switch (left) {
case 7:
state->padding |= ((uint64_t) in[6]) << 48;
/* fall through */
_fallthrough_;
case 6:
state->padding |= ((uint64_t) in[5]) << 40;
/* fall through */
_fallthrough_;
case 5:
state->padding |= ((uint64_t) in[4]) << 32;
/* fall through */
_fallthrough_;
case 4:
state->padding |= ((uint64_t) in[3]) << 24;
/* fall through */
_fallthrough_;
case 3:
state->padding |= ((uint64_t) in[2]) << 16;
/* fall through */
_fallthrough_;
case 2:
state->padding |= ((uint64_t) in[1]) << 8;
/* fall through */
_fallthrough_;
case 1:
state->padding |= ((uint64_t) in[0]);
/* fall through */
_fallthrough_;
case 0:
break;
}
+1 -2
View File
@@ -1382,8 +1382,7 @@ bool clock_supported(clockid_t clock) {
if (!clock_boottime_supported())
return false;
/* fall through */
_fallthrough_;
default:
/* For everything else, check properly */
return clock_gettime(clock, &ts) >= 0;