This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix warnings from generic _FPU_GETCW
- From: Chris Metcalf <cmetcalf at tilera dot com>
- To: libc-alpha at sourceware dot org
- Cc: Chris Metcalf <cmetcalf at tilera dot com>
- Date: Wed, 5 Dec 2012 14:00:13 -0500
- Subject: [PATCH] Fix warnings from generic _FPU_GETCW
- References: <Pine.LNX.4.64.1212051521590.1819@digraph.polyomino.org.uk>
2012-12-05 Chris Metcalf <cmetcalf@tilera.com>
* sysdeps/generic/fpu_control.h (_FPU_GETCW): Define to set cw to
0, not just to plain "0" as a statement.
(_FPU_SETCW): Define to (void) (cw), rather than doing nothing
with cw.
This change matches Joseph's recent MIPS-specific change to
ports/sysdeps/mips/fpu_control.h. It seems that tile (and maybe ia64)
are the only ports that use the sysdeps/generic header.
This change removes a warning from math/setfpucw.c. The generated
function is still a no-op since the compiler ignores the assignment
to a variable that isn't used.
OK to commit to main for 2.17?
diff --git a/sysdeps/generic/fpu_control.h b/sysdeps/generic/fpu_control.h
index b9134eb..5039052 100644
--- a/sysdeps/generic/fpu_control.h
+++ b/sysdeps/generic/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. Stub version.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -29,8 +29,8 @@
typedef unsigned int fpu_control_t;
/* Macros for accessing the hardware control word. */
-#define _FPU_GETCW(cw) 0
-#define _FPU_SETCW(cw) do { } while (0)
+#define _FPU_GETCW(cw) (cw) = 0
+#define _FPU_SETCW(cw) (void) (cw)
/* Default control word set at startup. */
extern fpu_control_t __fpu_control;
--
1.7.1