Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 May 2017 22:36:54 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318259 - head/lib/msun/src
Message-ID:  <201705132236.v4DMaswD077353@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705132236.v4DMaswD077353>