diff options
author | Elliot Ronaghan <ronawho@gmail.com> | 2016-06-08 21:20:32 (GMT) |
---|---|---|
committer | Elliot Ronaghan <ronawho@gmail.com> | 2016-06-08 21:20:32 (GMT) |
commit | fbd7956d45eda7e2717e263b983b6fd9d51b83a6 (patch) | |
tree | 64b798f44bf2f554c303907337801bbb1688a71b | |
parent | b9b35562893afd258d0dc94787acfe53153e5c65 (diff) | |
download | jemalloc-fbd7956d45eda7e2717e263b983b6fd9d51b83a6.zip jemalloc-fbd7956d45eda7e2717e263b983b6fd9d51b83a6.tar.gz jemalloc-fbd7956d45eda7e2717e263b983b6fd9d51b83a6.tar.bz2 |
Work around a weird pgi bug in test/unit/math.c
pgi fails to compile math.c, reporting that `-INFINITY` in `pt_norm_expected[]`
is a "Non-constant" expression. A simplified version of this failure is:
```c
#include <math.h>
static double inf1, inf2 = INFINITY; // no complaints
static double inf3 = INFINITY; // suddenly INFINITY is "Non-constant"
int main() { }
```
```sh
PGC-S-0074-Non-constant expression in initializer (t.c: 4)
```
pgi errors on the declaration of inf3, and will compile fine if that line is
removed. I've reported this bug to pgi, but in the meantime I just switched to
using (DBL_MAX + DBL_MAX) to work around this bug.
-rw-r--r-- | test/unit/math.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/unit/math.c b/test/unit/math.c index ebec77a..adb72be 100644 --- a/test/unit/math.c +++ b/test/unit/math.c @@ -5,6 +5,10 @@ #include <float.h> +#ifdef __PGI +#undef INFINITY +#endif + #ifndef INFINITY #define INFINITY (DBL_MAX + DBL_MAX) #endif |