svn commit: r318259 - head/lib/msun/src

Dimitry Andric dim at FreeBSD.org
Sat May 13 22:36:56 UTC 2017


Author: dim
Date: Sat May 13 22:36:54 2017
New Revision: 318259
URL: https://svnweb.freebsd.org/changeset/base/318259

Log:
  Silence a -Wunused warning about the junk variable being used to raise
  an inexact floating point exception.  The variable cannot be eliminated,
  unfortunately, otherwise the desired addition triggering the exception
  will be emitted neither by clang, nor by gcc.
  
  Reviewed by:	Steve Kargl, bde
  MFC after:	3 days

Modified:
  head/lib/msun/src/catrig.c
  head/lib/msun/src/catrigf.c
  head/lib/msun/src/catrigl.c

Modified: head/lib/msun/src/catrig.c
==============================================================================
--- head/lib/msun/src/catrig.c	Sat May 13 20:28:32 2017	(r318258)
+++ head/lib/msun/src/catrig.c	Sat May 13 22:36:54 2017	(r318259)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)	(fabs(x) == INFINITY)
 #undef isnan
 #define isnan(x)	((x) != (x))
-#define	raise_inexact()	do { volatile float junk = 1 + tiny; } while(0)
+#define	raise_inexact()	do { volatile float junk __unused = 1 + tiny; } while(0)
 #undef signbit
 #define signbit(x)	(__builtin_signbit(x))
 

Modified: head/lib/msun/src/catrigf.c
==============================================================================
--- head/lib/msun/src/catrigf.c	Sat May 13 20:28:32 2017	(r318258)
+++ head/lib/msun/src/catrigf.c	Sat May 13 22:36:54 2017	(r318259)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)	(fabsf(x) == INFINITY)
 #undef isnan
 #define isnan(x)	((x) != (x))
-#define	raise_inexact()	do { volatile float junk = 1 + tiny; } while(0)
+#define	raise_inexact()	do { volatile float junk __unused = 1 + tiny; } while(0)
 #undef signbit
 #define signbit(x)	(__builtin_signbitf(x))
 

Modified: head/lib/msun/src/catrigl.c
==============================================================================
--- head/lib/msun/src/catrigl.c	Sat May 13 20:28:32 2017	(r318258)
+++ head/lib/msun/src/catrigl.c	Sat May 13 22:36:54 2017	(r318259)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
 #define isinf(x)	(fabsl(x) == INFINITY)
 #undef isnan
 #define isnan(x)	((x) != (x))
-#define	raise_inexact()	do { volatile float junk = 1 + tiny; } while(0)
+#define	raise_inexact()	do { volatile float junk __unused = 1 + tiny; } while(0)
 #undef signbit
 #define signbit(x)	(__builtin_signbitl(x))
 


More information about the svn-src-head mailing list