about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2014-02-07 15:26:28 -0800
committerRoland McGrath <roland@hack.frob.com>2014-02-07 15:26:28 -0800
commit32749f6cd23f65a2df1bafbf9b69749bdded4b10 (patch)
tree286f6a962fd5c4b8e539cc59d4f6b2f8b0b1edc2
parentd5b396c1c89ed3026fc89bfcdd72b14d59972e45 (diff)
downloadglibc-32749f6cd23f65a2df1bafbf9b69749bdded4b10.tar.gz
glibc-32749f6cd23f65a2df1bafbf9b69749bdded4b10.tar.xz
glibc-32749f6cd23f65a2df1bafbf9b69749bdded4b10.zip
Avoid comma operator warnings.
-rw-r--r--ChangeLog9
-rw-r--r--bits/sigset.h10
-rw-r--r--include/signal.h3
-rw-r--r--sysdeps/generic/malloc-machine.h2
4 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a2967ac884..fef262070c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-02-07  Roland McGrath  <roland@hack.frob.com>
+
+	* bits/sigset.h (__sigemptyset): Use a statement expression rather
+	than the comma operator, to avoid "rhs of comma has no effect"
+	compiler warnings.
+	(__sigfillset, __sigandset, __sigorset): Likewise.
+	* include/signal.h (__sigemptyset): Likewise.
+	* sysdeps/generic/malloc-machine.h (mutex_lock): Likewise.
+
 2014-02-07  Allan McRae  <allan@archlinux.org>
 
 	* version.h (RELEASE): Set to "development".
diff --git a/bits/sigset.h b/bits/sigset.h
index 23a6c1fd83..e5fac54ede 100644
--- a/bits/sigset.h
+++ b/bits/sigset.h
@@ -44,15 +44,17 @@ typedef unsigned long int __sigset_t;
    overflow if `sigset_t' is wider than `int'.  */
 #define	__sigmask(sig)	(((__sigset_t) 1) << ((sig) - 1))
 
-#define	__sigemptyset(set)	((*(set) = (__sigset_t) 0), 0)
-#define	__sigfillset(set)	((*(set) = ~(__sigset_t) 0), 0)
+#define	__sigemptyset(set)	\
+  (__extension__ ({ *(set) = (__sigset_t) 0; 0; })
+#define	__sigfillset(set)	\
+  (__extension__ ({ *(set) = ~(__sigset_t) 0; 0; }))
 
 #ifdef _GNU_SOURCE
 # define __sigisemptyset(set)	(*(set) == (__sigset_t) 0)
 # define __sigandset(dest, left, right) \
-				((*(dest) = (*(left) & *(right))), 0)
+  (__extension__ ({ *(dest) = *(left) & *(right); 0; }))
 # define __sigorset(dest, left, right) \
-				((*(dest) = (*(left) | *(right))), 0)
+  (__extension__ ({ *(dest) = *(left) | *(right); 0; }))
 #endif
 
 /* These functions needn't check for a bogus signal number -- error
diff --git a/include/signal.h b/include/signal.h
index a019395882..16a7a4289a 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -55,7 +55,8 @@ extern int __xpg_sigpause (int sig);
 
 /* Simplified sigemptyset() implementation without the parameter checking.  */
 #undef __sigemptyset
-#define __sigemptyset(ss) (__builtin_memset (ss, '\0', sizeof (sigset_t)), 0)
+#define __sigemptyset(ss) \
+  ({ __builtin_memset (ss, '\0', sizeof (sigset_t)); 0; })
 
 
 /* Allocate real-time signal with highest/lowest available priority.  */
diff --git a/sysdeps/generic/malloc-machine.h b/sysdeps/generic/malloc-machine.h
index df7adebe26..a1b7655fbc 100644
--- a/sysdeps/generic/malloc-machine.h
+++ b/sysdeps/generic/malloc-machine.h
@@ -35,7 +35,7 @@
 typedef int mutex_t;
 
 # define mutex_init(m)          (*(m) = 0)
-# define mutex_lock(m)          ((*(m) = 1), 0)
+# define mutex_lock(m)          ({ *(m) = 1; 0; })
 # define mutex_trylock(m)       (*(m) ? 1 : ((*(m) = 1), 0))
 # define mutex_unlock(m)        (*(m) = 0)
 # define MUTEX_INITIALIZER      (0)