Message ID | 54CC7085.1080805@sunrus.com.cn |
---|---|
State | New |
Headers | show |
Chen Gang S <gang.chen@sunrus.com.cn> writes: > * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces > instead of macro's empty body to avoid xgcc warnings. It's actually an empty loop now. Andreas.
On 1/31/15 16:53, Andreas Schwab wrote: > Chen Gang S <gang.chen@sunrus.com.cn> writes: > >> * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces >> instead of macro's empty body to avoid xgcc warnings. > > It's actually an empty loop now. > Excuse me, I am not quite clear gcc version merging working flow. Now, for gcc master branch (20150131), __GTHREAD_MUTEX_INIT_FUNCTION is still as empty. Could you provide more details about it? Thanks.
On 31 January 2015 at 15:30, Chen Gang S <gang.chen@sunrus.com.cn> wrote: > On 1/31/15 16:53, Andreas Schwab wrote: >> Chen Gang S <gang.chen@sunrus.com.cn> writes: >> >>> * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces >>> instead of macro's empty body to avoid xgcc warnings. The ChangeLog entry should be fixed to reflect it's an empty loop now. something like: * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use empty do-while loop as macro body to avoid xgcc warnings. Thanks, Prathamesh >> >> It's actually an empty loop now. >> > > Excuse me, I am not quite clear gcc version merging working flow. Now, > for gcc master branch (20150131), __GTHREAD_MUTEX_INIT_FUNCTION is still > as empty. > > Could you provide more details about it? > > Thanks. > -- > Chen Gang > > Open, share, and attitude like air, water, and life which God blessed
On Sat, Jan 31, 2015 at 05:13:53PM +0530, Prathamesh Kulkarni wrote: > On 31 January 2015 at 15:30, Chen Gang S <gang.chen@sunrus.com.cn> wrote: > > On 1/31/15 16:53, Andreas Schwab wrote: > >> Chen Gang S <gang.chen@sunrus.com.cn> writes: > >> > >>> * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces > >>> instead of macro's empty body to avoid xgcc warnings. > The ChangeLog entry should be fixed to reflect it's an empty loop now. > something like: > * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use empty do-while > loop as macro body to avoid xgcc warnings. And since CL entries should describe what, not why, the "to avoid..." part is redundant. Marek
On 1/31/15 19:49, Marek Polacek wrote: > On Sat, Jan 31, 2015 at 05:13:53PM +0530, Prathamesh Kulkarni wrote: >> On 31 January 2015 at 15:30, Chen Gang S <gang.chen@sunrus.com.cn> wrote: >>> On 1/31/15 16:53, Andreas Schwab wrote: >>>> Chen Gang S <gang.chen@sunrus.com.cn> writes: >>>> >>>>> * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use braces >>>>> instead of macro's empty body to avoid xgcc warnings. >> The ChangeLog entry should be fixed to reflect it's an empty loop now. >> something like: >> * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Use empty do-while >> loop as macro body to avoid xgcc warnings. > > And since CL entries should describe what, not why, the "to avoid..." > part is redundant. > OK, thanks. I should send patch v3 within today. Thanks.
On 01/30/2015 11:04 PM, Chen Gang S wrote: > 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. OK for the trunk. jeff
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))