This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH] tile: avoid compiler warning in feraiseexcept() math_private override
- From: Chris Metcalf <cmetcalf at tilera dot com>
- To: <libc-ports at sourceware dot org>
- Date: Tue, 15 May 2012 18:30:57 +0000
- Subject: [PATCH] tile: avoid compiler warning in feraiseexcept() math_private override
---
Is there a more self-descriptive way to achieve this effect?
I'll go ahead and commit this in a day or two if I don't hear any
better suggestions.
Note that the same problem exists for _FPU_GETCW(cw) in
sysdeps/generic/fpu_control.h, so arguably the same solution should be
used there. I'll propose that as a separate patch if this one
seems acceptable.
ChangeLog.tile | 5 +++++
sysdeps/tile/math_private.h | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog.tile b/ChangeLog.tile
index 38fec36..3a0a82d 100644
--- a/ChangeLog.tile
+++ b/ChangeLog.tile
@@ -0,0 +1,5 @@
+2012-05-15 Chris Metcalf <cmetcalf@tilera.com>
+
+ * sysdeps/tile/math_private.h (feraiseexcept): Use statement
+ expression syntax to avoid compiler warning.
+
diff --git a/sysdeps/tile/math_private.h b/sysdeps/tile/math_private.h
index 2dab42b..858db4a 100644
--- a/sysdeps/tile/math_private.h
+++ b/sysdeps/tile/math_private.h
@@ -6,7 +6,8 @@
And since we don't define FE_INVALID, FE_DIVBYZERO, etc., we
must ignore the argument of feraiseexcept() as well. we return
"1" to indicate we failed to raise an exception, though none of
- the callers in glibc actually care. */
-#define feraiseexcept(excepts) 1
+ the callers in glibc actually care. The extra level of statement
+ expression wrapping avoids "statement with no effect" warnings. */
+#define feraiseexcept(excepts) ({ 1; })
#endif
--
1.6.5.2