[buddy] workaround newer clang warning
It seems clang now warn about fallthrough case statements in C, but ignore any /* fall through */ comment if that comes from a macro. * src/bddop.c: Use the fallthrough attribute if available.
This commit is contained in:
parent
82d69241f1
commit
118df55bc3
1 changed files with 11 additions and 2 deletions
|
|
@ -42,6 +42,15 @@
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
|
#ifdef __has_attribute
|
||||||
|
# if __has_attribute(fallthrough)
|
||||||
|
# define BUDDY_FALLTHROUGH __attribute__ ((fallthrough))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef BUDDY_FALLTHROUGH
|
||||||
|
# define BUDDY_FALLTHROUGH while (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Hash value modifiers to distinguish between entries in misccache */
|
/* Hash value modifiers to distinguish between entries in misccache */
|
||||||
#define CACHEID_CONSTRAIN 0x0
|
#define CACHEID_CONSTRAIN 0x0
|
||||||
#define CACHEID_RESTRICT 0x1
|
#define CACHEID_RESTRICT 0x1
|
||||||
|
|
@ -640,7 +649,7 @@ static BDD apply_rec(BDD l, BDD r)
|
||||||
r = tmp; \
|
r = tmp; \
|
||||||
op = bddop_imp; \
|
op = bddop_imp; \
|
||||||
} \
|
} \
|
||||||
/* fall through */ \
|
BUDDY_FALLTHROUGH; \
|
||||||
case bddop_imp: \
|
case bddop_imp: \
|
||||||
if (ISONE(r) || ISZERO(l)) \
|
if (ISONE(r) || ISZERO(l)) \
|
||||||
return 1; \
|
return 1; \
|
||||||
|
|
@ -666,7 +675,7 @@ static BDD apply_rec(BDD l, BDD r)
|
||||||
r = tmp; \
|
r = tmp; \
|
||||||
op = bddop_diff; \
|
op = bddop_diff; \
|
||||||
} \
|
} \
|
||||||
/* fall through */ \
|
BUDDY_FALLTHROUGH; \
|
||||||
case bddop_diff: /* l - r = l &! r */ \
|
case bddop_diff: /* l - r = l &! r */ \
|
||||||
if (l == r || ISONE(r)) \
|
if (l == r || ISONE(r)) \
|
||||||
return 0; \
|
return 0; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue