From 84c03130280c7c4c44b8585a1ae44d5afe996684 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 25 Nov 2016 14:10:37 +0300 Subject: [PATCH] Suppress 'taking address of label non-standard' GCC/Clang pedantic warning * mark.c [WRAP_MARK_SOME && __GNUC__ && (MSWIN32 || MSWINCE)] (GC_mark_some): Use pragma "GCC diagnostic ignored" to temporarily suppress "taking the address of a label is non-standard" (or "use of GNU address-of-label extension" in case of Clang) warning for "&&handle_ex" expression. --- mark.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mark.c b/mark.c index b83ad913..6a049737 100644 --- a/mark.c +++ b/mark.c @@ -510,7 +510,22 @@ static void alloc_mark_stack(size_t); ext_ex_regn er; - er.alt_path = &&handle_ex; +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \ + || __clang_major__ > 3 \ + || (__clang_major__ == 3 && __clang_minor__ >= 6) +# pragma GCC diagnostic push + /* Suppress "taking the address of label is non-standard" warning. */ +# if defined(__clang__) +# pragma GCC diagnostic ignored "-Wpedantic" +# else + /* GCC before ~4.8 does not accept "-Wpedanic" quietly. */ +# pragma GCC diagnostic ignored "-pedantic" +# endif + er.alt_path = &&handle_ex; +# pragma GCC diagnostic pop +# else /* pragma diagnostic is not supported */ + er.alt_path = &&handle_ex; +# endif er.ex_reg.handler = mark_ex_handler; __asm__ __volatile__ ("movl %%fs:0, %0" : "=r" (er.ex_reg.prev)); __asm__ __volatile__ ("movl %0, %%fs:0" : : "r" (&er)); -- 2.40.0