Fix "set but not used" warnings for X##_s in soft-fp

Joseph S. Myers joseph@codesourcery.com
Wed Dec 5 18:10:00 GMT 2012


In soft-fp, the macro _FP_DECL declares one of the variables it
declares, X##_c, with __attribute__ ((unused)), since some users may
not use all three variables, but not another X##_s.  However,
unordsf2.c and unorddf2.c do not use this variable, resulting in "set
but not used" warnings for it.  This patch fixes these warnings
(tested powerpc-nofpu) by using the attribute on X##_s as well.

2012-12-05  Joseph Myers  <joseph@codesourcery.com>

	* soft-fp/op-common.h (_FP_DECL): Declare X##_s with __attribute__
	((unused)).

diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h
index 12fb16e..8855ad3 100644
--- a/soft-fp/op-common.h
+++ b/soft-fp/op-common.h
@@ -29,8 +29,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#define _FP_DECL(wc, X)						\
-  _FP_I_TYPE X##_c __attribute__((unused)), X##_s, X##_e;	\
+#define _FP_DECL(wc, X)				\
+  _FP_I_TYPE X##_c __attribute__((unused));	\
+  _FP_I_TYPE X##_s __attribute__((unused));	\
+  _FP_I_TYPE X##_e;				\
   _FP_FRAC_DECL_##wc(X)
 
 /*

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list