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
This commit is contained in:
Dimitry Andric 2017-05-13 22:36:54 +00:00
parent 73a73f7bd2
commit 3a462c983d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318259
3 changed files with 3 additions and 3 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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))