The attached patch fixes the annoying warnings generated by diagnostic_set_last_function.
Can this be committed? Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany
gcc/ChangeLog * tree-diagnostic.h (diagnostic_set_last_function): Fix warning.
>From b09e69bd66f157a2aaf0167b7419f47e9953950a Mon Sep 17 00:00:00 2001 From: Dominik Vogt <v...@linux.vnet.ibm.com> Date: Mon, 2 Nov 2015 13:58:53 +0100 Subject: [PATCH] Fix warning in tree-diagnostic.h. --- gcc/tree-diagnostic.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/tree-diagnostic.h b/gcc/tree-diagnostic.h index c1cc1c5..60c6f1c 100644 --- a/gcc/tree-diagnostic.h +++ b/gcc/tree-diagnostic.h @@ -43,10 +43,13 @@ along with GCC; see the file COPYING3. If not see /* Remember the current function as being the last one in which we report a diagnostic. */ #define diagnostic_set_last_function(DC, DI) \ - diagnostic_context_auxiliary_data (DC) \ - = (((DI) && diagnostic_abstract_origin (DI)) \ - ? diagnostic_abstract_origin (DI) \ - : current_function_decl) + do { \ + __typeof__ (DI) __x = (DI); \ + diagnostic_context_auxiliary_data (DC) \ + = (((__x) && diagnostic_abstract_origin (__x)) \ + ? diagnostic_abstract_origin (__x) \ + : current_function_decl); \ + } while (0) void diagnostic_report_current_function (diagnostic_context *, diagnostic_info *); -- 2.3.0