Skip to content

Commit 8f36cf6

Browse files
authored
Merge pull request #1355 from mildas/disable_switch_fallthrough_warnings
Disable fallthrough warnings in switch
2 parents 58352d3 + 8897f1e commit 8f36cf6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/OVAL/probes/SEAP/MurmurHash3.c

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

128128
uint32_t k1 = 0;
129129

130+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
131+
#pragma GCC diagnostic push
132+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
130133
switch(len & 3)
131134
{
132135
case 3: k1 ^= tail[2] << 16;
133136
case 2: k1 ^= tail[1] << 8;
134137
case 1: k1 ^= tail[0];
135138
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
136139
};
140+
#pragma GCC diagnostic pop
141+
#endif
137142

138143
//----------
139144
// finalization
@@ -202,6 +207,9 @@ void MurmurHash3_x86_128 ( const void * key, const int len,
202207
uint32_t k3 = 0;
203208
uint32_t k4 = 0;
204209

210+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
211+
#pragma GCC diagnostic push
212+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
205213
switch(len & 15)
206214
{
207215
case 15: k4 ^= tail[14] << 16;
@@ -227,6 +235,8 @@ void MurmurHash3_x86_128 ( const void * key, const int len,
227235
case 1: k1 ^= tail[ 0] << 0;
228236
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
229237
};
238+
#pragma GCC diagnostic pop
239+
#endif
230240

231241
//----------
232242
// finalization
@@ -291,6 +301,9 @@ void MurmurHash3_x64_128 ( const void * key, const int len,
291301
uint64_t k1 = 0;
292302
uint64_t k2 = 0;
293303

304+
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
305+
#pragma GCC diagnostic push
306+
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
294307
switch(len & 15)
295308
{
296309
case 15: k2 ^= (uint64_t)(tail[14]) << 48;
@@ -312,6 +325,8 @@ void MurmurHash3_x64_128 ( const void * key, const int len,
312325
case 1: k1 ^= (uint64_t)(tail[ 0]) << 0;
313326
k1 *= c1; k1 = ROTL64(k1,31); k1 *= c2; h1 ^= k1;
314327
};
328+
#pragma GCC diagnostic pop
329+
#endif
315330

316331
//----------
317332
// finalization

0 commit comments

Comments
 (0)