summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-01-23 22:35:16 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-01-23 22:35:16 (GMT)
commit6486e06545bf637d46e18a787395542f4fca143a (patch)
tree66a8cfc5bb4844ebe24e59163589fbb17cc2f14a /src
parent12bc75c6172ca7b64c33b17cf538a7629500cf2f (diff)
downloadhdf5-6486e06545bf637d46e18a787395542f4fca143a.zip
hdf5-6486e06545bf637d46e18a787395542f4fca143a.tar.gz
hdf5-6486e06545bf637d46e18a787395542f4fca143a.tar.bz2
Revert "Moved -Wunsuffixed-float-constants to the developer warnings."
This reverts commit 12bc75c6172ca7b64c33b17cf538a7629500cf2f.
Diffstat (limited to 'src')
-rw-r--r--src/H5private.h15
-rw-r--r--src/H5trace.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h
index bc6c8a5..c3375df 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -540,6 +540,21 @@
# define H5_DEC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)-1))
#endif
+/* Double constant wrapper
+ *
+ * Quiets gcc warnings from -Wunsuffixed-float-constants.
+ *
+ * This is a really annoying warning since the standard specifies that
+ * constants of type double do NOT get a suffix so there's no way
+ * to specify a constant of type double. To quiet gcc, we specify floating
+ * point constants as type long double and cast to double.
+ *
+ * Note that this macro only needs to be used where using a double
+ * is important. For most code, suffixing constants with F will quiet the
+ * compiler and not produce erroneous code.
+ */
+#define H5_DOUBLE(S) ((double) S ## L)
+
/*
* Methods to compare the equality of floating-point values:
*
diff --git a/src/H5trace.c b/src/H5trace.c
index ec5c6a2..4a24804 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -155,7 +155,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
} /* end if */
/* Get time for event */
- if(H5_DBL_ABS_EQUAL(first_time.etime, 0.0))
+ if(H5_DBL_ABS_EQUAL(first_time.etime, H5_DOUBLE(0.0)))
H5_timer_begin(&first_time);
if(H5_debug_g.ttimes)
H5_timer_begin(&event_time);