public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix warning in tree-diagnostic.h.
@ 2015-11-02 13:27 Dominik Vogt
  2015-11-02 16:57 ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Dominik Vogt @ 2015-11-02 13:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ulrich Weigand, andreas

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

The attached patch fixes the annoying warnings generated by
diagnostic_set_last_function.

Can this be committed?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-ChangeLog --]
[-- Type: text/plain, Size: 81 bytes --]

gcc/ChangeLog

	* tree-diagnostic.h (diagnostic_set_last_function): Fix warning.

[-- Attachment #3: 0001-Fix-warning-in-tree-diagnostic.h.patch --]
[-- Type: text/x-diff, Size: 1186 bytes --]

From b09e69bd66f157a2aaf0167b7419f47e9953950a Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-17  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 13:27 [PATCH] Fix warning in tree-diagnostic.h Dominik Vogt
2015-11-02 16:57 ` Jeff Law
2015-11-03  9:57   ` Dominik Vogt
2015-11-06 22:16     ` Jeff Law
2015-11-17  9:02       ` Dominik Vogt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).