summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 78d3d9d..731a7f6 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -2345,7 +2345,11 @@ func_init_failed: \
#define H5_GLUE4(w,x,y,z) w##x##y##z
/* Compile-time "assert" macro */
-#define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0)
+#define HDcompile_assert(e) ((void)sizeof(char[ !!(e) ? 1 : -1]))
+/* Variants that are correct, but generate compile-time warnings in some circumstances:
+ #define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0)
+ #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0)
+*/
/* Private functions, not part of the publicly documented API */
H5_DLL herr_t H5_init_library(void);