Skip to content

Commit 023ffd2

Browse files
committed
Disable fallthrough warnings in switch where fallthrough is intended.
1 parent ff46197 commit 023ffd2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/OVAL/probes/SEAP/MurmurHash3.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,16 @@ void MurmurHash3_x86_32 ( const void * key, int len,
127127

128128
uint32_t k1 = 0;
129129

130+
#pragma GCC diagnostic push
131+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
130132
switch(len & 3)
131133
{
132134
case 3: k1 ^= tail[2] << 16;
133135
case 2: k1 ^= tail[1] << 8;
134136
case 1: k1 ^= tail[0];
135137
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
136138
};
139+
#pragma GCC diagnostic pop
137140

138141
//----------
139142
// finalization
@@ -202,6 +205,8 @@ void MurmurHash3_x86_128 ( const void * key, const int len,
202205
uint32_t k3 = 0;
203206
uint32_t k4 = 0;
204207

208+
#pragma GCC diagnostic push
209+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
205210
switch(len & 15)
206211
{
207212
case 15: k4 ^= tail[14] << 16;
@@ -227,6 +232,7 @@ void MurmurHash3_x86_128 ( const void * key, const int len,
227232
case 1: k1 ^= tail[ 0] << 0;
228233
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
229234
};
235+
#pragma GCC diagnostic pop
230236

231237
//----------
232238
// finalization
@@ -291,6 +297,8 @@ void MurmurHash3_x64_128 ( const void * key, const int len,
291297
uint64_t k1 = 0;
292298
uint64_t k2 = 0;
293299

300+
#pragma GCC diagnostic push
301+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
294302
switch(len & 15)
295303
{
296304
case 15: k2 ^= (uint64_t)(tail[14]) << 48;
@@ -312,6 +320,7 @@ void MurmurHash3_x64_128 ( const void * key, const int len,
312320
case 1: k1 ^= (uint64_t)(tail[ 0]) << 0;
313321
k1 *= c1; k1 = ROTL64(k1,31); k1 *= c2; h1 ^= k1;
314322
};
323+
#pragma GCC diagnostic pop
315324

316325
//----------
317326
// finalization

0 commit comments

Comments
 (0)