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:
dim 2017-05-13 22:36:54 +00:00
parent 19a05788e4
commit d063bb9ea0
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))