* Fix warnings from MIPS soft-float _FPU_GETCW
@ 2012-12-04 22:08 Joseph S. Myers
2012-12-05 15:15 ` Chris Metcalf
0 siblings, 1 reply; 3+ messages in thread
From: Joseph S. Myers @ 2012-12-04 22:08 UTC (permalink / raw)
To: libc-ports
Testing for MIPS soft-float showed up compile warnings ("statement
with no effect") in setfpucw.c arising from the soft-float definition
of _FPU_GETCW just being "0". I've applied this patch to make the
definition actually store 0 in cw, and correspondingly to make
_FPU_SETCW use cw by casting the value to (void), to make these
soft-float definitions better at avoiding warnings from use using
these macros.
2012-12-04 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/fpu_control.h [__mips_soft_float] (_FPU_GETCW):
Define to set cw to 0, now just to plain "0" as a statement.
[__mips_soft_float] (_FPU_SETCW): Define to (void) (cw), rather
than doing nothing with cw.
diff --git a/ports/sysdeps/mips/fpu_control.h b/ports/sysdeps/mips/fpu_control.h
index 7307d03..acf794c 100644
--- a/ports/sysdeps/mips/fpu_control.h
+++ b/ports/sysdeps/mips/fpu_control.h
@@ -1,6 +1,5 @@
/* FPU control word bits. Mips version.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2006, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Olaf Flebbe and Ralf Baechle.
@@ -63,8 +62,8 @@
#define _FPU_RESERVED 0xffffffff
#define _FPU_DEFAULT 0x00000000
typedef unsigned int fpu_control_t;
-#define _FPU_GETCW(cw) 0
-#define _FPU_SETCW(cw) do { } while (0)
+#define _FPU_GETCW(cw) (cw) = 0
+#define _FPU_SETCW(cw) (void) (cw)
extern fpu_control_t __fpu_control;
#else /* __mips_soft_float */
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix warnings from MIPS soft-float _FPU_GETCW
2012-12-04 22:08 Fix warnings from MIPS soft-float _FPU_GETCW Joseph S. Myers
@ 2012-12-05 15:15 ` Chris Metcalf
2012-12-05 15:23 ` Joseph S. Myers
0 siblings, 1 reply; 3+ messages in thread
From: Chris Metcalf @ 2012-12-05 15:15 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: libc-ports
On 12/4/2012 5:07 PM, Joseph S. Myers wrote:
> Testing for MIPS soft-float showed up compile warnings ("statement
> with no effect") in setfpucw.c arising from the soft-float definition
> of _FPU_GETCW just being "0". I've applied this patch to make the
> definition actually store 0 in cw, and correspondingly to make
> _FPU_SETCW use cw by casting the value to (void), to make these
> soft-float definitions better at avoiding warnings from use using
> these macros.
>
> 2012-12-04 Joseph Myers <joseph@codesourcery.com>
>
> * sysdeps/mips/fpu_control.h [__mips_soft_float] (_FPU_GETCW):
> Define to set cw to 0, now just to plain "0" as a statement.
> [__mips_soft_float] (_FPU_SETCW): Define to (void) (cw), rather
> than doing nothing with cw.
I see the same warning on tile, because we are using sysdeps/generic/fpu_control.h, which has the same issue. Do you want to fix that file as well as the mips one while you're at it? Or should I push that same fix?
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix warnings from MIPS soft-float _FPU_GETCW
2012-12-05 15:15 ` Chris Metcalf
@ 2012-12-05 15:23 ` Joseph S. Myers
0 siblings, 0 replies; 3+ messages in thread
From: Joseph S. Myers @ 2012-12-05 15:23 UTC (permalink / raw)
To: Chris Metcalf; +Cc: libc-ports
On Wed, 5 Dec 2012, Chris Metcalf wrote:
> I see the same warning on tile, because we are using
> sysdeps/generic/fpu_control.h, which has the same issue. Do you want to
> fix that file as well as the mips one while you're at it? Or should I
> push that same fix?
If you observe warnings on an architecture you are testing and have a
patch to fix those warnings, please post the patch as usual (to libc-alpha
in this case). In general architecture maintainers should be reviewing
warning state, as well as test results, for their architectures for 2.17
and trying to get both into good shape for the release.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-05 15:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 22:08 Fix warnings from MIPS soft-float _FPU_GETCW Joseph S. Myers
2012-12-05 15:15 ` Chris Metcalf
2012-12-05 15:23 ` Joseph S. Myers
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).