On 4/16/19 7:22 AM, Richard Henderson wrote: > diff --git a/target/riscv/translate.c b/target/riscv/translate.c > index fb66e886bf..c96c616539 100644 > --- a/target/riscv/translate.c > +++ b/target/riscv/translate.c > @@ -695,6 +695,7 @@ static bool gen_shift(DisasContext *ctx, arg_r *a, > */ > #pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wredundant-decls" > +#pragma GCC diagnostic ignored "-Wtypedef-redefinition"
Bah. Of course gcc doesn't know this one. And looking closer elsewhere, I see we've got a configure test for the pragmas, which I suppose I ought to use. r~ diff --git a/target/riscv/translate.c b/target/riscv/translate.c index fb66e886bf..b62ca04281 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -693,12 +693,19 @@ static bool gen_shift(DisasContext *ctx, arg_r *a, * initially declared by the 32-bit decoder, which results in duplicate * declaration warnings. Suppress them. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wredundant-decls" +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wredundant-decls" +# ifdef __clang__ +# pragma GCC diagnostic ignored "-Wtypedef-redefinition" +# endif +#endif #include "decode_insn16.inc.c" -#pragma GCC diagnostic pop +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +# pragma GCC diagnostic pop +#endif static void decode_opc(DisasContext *ctx) {