public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] libgcc: Use braces instead of macro's empty body to avoid xgcc warnings.
@ 2015-01-31 11:33 Chen Gang S
  2015-01-31 12:34 ` Andreas Schwab
  2015-04-14  5:30 ` Jeff Law
  0 siblings, 2 replies; 8+ messages in thread
From: Chen Gang S @ 2015-01-31 11:33 UTC (permalink / raw)
  To: ian, Jakub Jelinek; +Cc: walt, Jeff Law, gcc-patches List

The related warning (cross compile tile with --disable-threads):

  ../../../../gcc-tile-new/libgcc/libgcov-interface.c: In function '__gcov_fork':
  ../../../../gcc-tile-new/libgcc/libgcov-interface.c:182:53: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
       __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx);
                                                       ^
2015-01-31  Chen Gang  <gang.chen.5i5j@gmail.com>

	* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces
	instead of macro's empty body to avoid xgcc warnings.
---
 libgcc/gthr-single.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgcc/gthr-single.h b/libgcc/gthr-single.h
index f084fe2..01366f53 100644
--- a/libgcc/gthr-single.h
+++ b/libgcc/gthr-single.h
@@ -35,7 +35,7 @@ typedef int __gthread_recursive_mutex_t;
 
 #define __GTHREAD_ONCE_INIT 0
 #define __GTHREAD_MUTEX_INIT 0
-#define __GTHREAD_MUTEX_INIT_FUNCTION(mx)
+#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) do {} while (0)
 #define __GTHREAD_RECURSIVE_MUTEX_INIT 0
 
 #define UNUSED __attribute__((unused))
-- 
1.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH v2] libgcc: Use braces instead of macro's empty body to avoid xgcc warnings.
@ 2015-04-15 15:29 Jeff Law
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Law @ 2015-04-15 15:29 UTC (permalink / raw)
  To: gcc-patches

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


This patch was originally from Chen Gang S.  However, his address at 
sunrus.com.cn bounces.  So presumably he didn't get the approved 
message.  I'm checking in the patch for him (with the fixed ChangeLog).

I've verified by hand that the warning goes away with a cross toolchain 
and that it doesn't affect x86_64-unknown-linux-gnu.




[-- Attachment #2: Re: [PATCH v2] libgcc: Use braces instead of macro's empty body to.eml --]
[-- Type: application/x-message-display, Size: 2546 bytes --]

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

end of thread, other threads:[~2015-04-15 15:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31 11:33 [PATCH v2] libgcc: Use braces instead of macro's empty body to avoid xgcc warnings Chen Gang S
2015-01-31 12:34 ` Andreas Schwab
2015-01-31 14:50   ` Chen Gang S
2015-01-31 15:45     ` Prathamesh Kulkarni
2015-01-31 15:45       ` Marek Polacek
2015-01-31 19:51         ` Chen Gang S
2015-04-14  5:30 ` Jeff Law
2015-04-15 15:29 Jeff Law

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