public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gold: add cast to gold_unreachable to workaround gcc giving   invalid "no return statement" warnings
@ 2009-08-13 15:09 Mikolaj Zalewski
  2009-08-14  8:34 ` Ian Lance Taylor
  2009-08-31 21:49 ` [PATCH] Gold: Added R_ARM_ABS8 relocation Viktor Kutuzov
  0 siblings, 2 replies; 25+ messages in thread
From: Mikolaj Zalewski @ 2009-08-13 15:09 UTC (permalink / raw)
  To: binutils

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

  I couldn't compile gold today because of the "no return statement"
warning when using gold_unreachable. At
http://gcc.gnu.org/ml/gcc-bugs/2007-11/msg01605.html I've found a
workaround that should work for gcc >= 3.4. Such a patch that affects
only gold_unreachable is ok?

2009-08-13  Mikolaj Zalewski  <mikolajz@google.com>

	* gold.h (gold_unreachable): Add a cast.

[-- Attachment #2: 0001-gold-add-cast-to-gold_unreachable-to-workaround-gcc.patch --]
[-- Type: text/x-diff, Size: 1041 bytes --]

From 2c4c78358538c7b260a2d23a66add87e28d9a1ad Mon Sep 17 00:00:00 2001
From: Mikolaj Zalewski <mikolajz@google.com>
Date: Thu, 13 Aug 2009 16:56:44 +0200
Subject: [PATCH] gold: add cast to gold_unreachable to workaround gcc giving invalid "no return statement" warnings

---
 gold/gold.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gold/gold.h b/gold/gold.h
index 1319699..3c9971d 100644
--- a/gold/gold.h
+++ b/gold/gold.h
@@ -255,9 +255,11 @@ gold_nomem() ATTRIBUTE_NORETURN;
 
 // This macro and function are used in cases which can not arise if
 // the code is written correctly.
+// Note: the cast of __FUNCTION__ is needed to workaround gcc bug
+// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30988 causing invalid warnings.
 
 #define gold_unreachable() \
-  (gold::do_gold_unreachable(__FILE__, __LINE__, __FUNCTION__))
+  (gold::do_gold_unreachable(__FILE__, __LINE__, (const char *)__FUNCTION__))
 
 extern void do_gold_unreachable(const char*, int, const char*)
   ATTRIBUTE_NORETURN;
-- 
1.5.4.3


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

end of thread, other threads:[~2009-10-07 15:31 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-13 15:09 [PATCH] gold: add cast to gold_unreachable to workaround gcc giving invalid "no return statement" warnings Mikolaj Zalewski
2009-08-14  8:34 ` Ian Lance Taylor
2009-08-14  9:28   ` Mikolaj Zalewski
2009-08-14  9:36     ` Ian Lance Taylor
2009-08-31 21:49 ` [PATCH] Gold: Added R_ARM_ABS8 relocation Viktor Kutuzov
2009-08-31 23:52   ` Gold: Testsuite Viktor Kutuzov
2009-09-01  0:46     ` Ian Lance Taylor
2009-09-01  1:02       ` Viktor Kutuzov
2009-09-01  2:10         ` Ian Lance Taylor
     [not found]           ` <6AE1604EE3EC5F4296C096518C6B77EEE56FBF60@mail.accesssoftek.com>
2009-09-02  1:31             ` Viktor Kutuzov
2009-09-01  0:56   ` [PATCH] Gold: Added R_ARM_ABS8 relocation Ian Lance Taylor
2009-09-01 19:53     ` [PATCH Take 2] " Viktor Kutuzov
2009-09-01 21:24       ` Ian Lance Taylor
2009-09-02  1:30         ` [PATCH] Gold: Added R_ARM_ABS8 relocation unit test Viktor Kutuzov
2009-09-16  0:23           ` [PATCH] Gold: Added R_ARM_GOT_PREL relocation and unit tests Viktor Kutuzov
2009-09-16  1:00             ` [Gold] Heads up. Working on interworking Viktor Kutuzov
2009-10-06 21:46               ` [GOLD] Heads up. Gold for mingw Viktor Kutuzov
2009-10-06 22:02                 ` Vincent R.
2009-10-06 22:26                   ` Viktor Kutuzov
2009-10-06 22:06                 ` Matt Rice
2009-10-07 15:31             ` [PATCH] Gold: Added R_ARM_GOT_PREL relocation and unit tests Ian Lance Taylor
     [not found]         ` <6AE1604EE3EC5F4296C096518C6B77EEE56FBF62@mail.accesssoftek.com>
2009-09-03 23:26           ` [PATCH, Take 2] Gold: Added R_ARM_ABS8 relocation unit test Viktor Kutuzov
2009-09-27  7:35             ` Ian Lance Taylor
2009-09-29 23:30               ` Viktor Kutuzov
2009-09-29 23:40                 ` Ian Lance Taylor

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).