The count is not itself an enumerator. Move it outside to prevent the compiler from considering it with -Wswitch-enum.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org> --- include/tcg/tcg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index afa18986b1..a631e0bc80 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -294,8 +294,6 @@ typedef enum TCGType { TCG_TYPE_V128, TCG_TYPE_V256, - TCG_TYPE_COUNT, /* number of different types */ - /* An alias for the size of the host register. */ #if TCG_TARGET_REG_BITS == 32 TCG_TYPE_REG = TCG_TYPE_I32, @@ -318,6 +316,9 @@ typedef enum TCGType { #endif } TCGType; +/* Number of different types */ +#define TCG_TYPE_COUNT (TCG_TYPE_V256 + 1) + /** * get_alignment_bits * @memop: MemOp value -- 2.34.1