summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-05-11 16:42:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-05-11 16:42:54 (GMT)
commitafc68537cd8cbbea9473f27b7f003f5ca418f77f (patch)
tree79510c7cd19db4ab4f7e4e19c82ca9c2b6525151 /src/H5private.h
parent260ed1d2bc81e7fe39aec06706b72d36fa81ecf0 (diff)
downloadhdf5-afc68537cd8cbbea9473f27b7f003f5ca418f77f.zip
hdf5-afc68537cd8cbbea9473f27b7f003f5ca418f77f.tar.gz
hdf5-afc68537cd8cbbea9473f27b7f003f5ca418f77f.tar.bz2
[svn-r23696] Description:
Bring r23695 from trunk to 1.8 branch: Clean up warnings in H5Tconv.c (down to _only_ 9000 lines of output now!) Merge changes from Coverity branch back to trunk: r20684: Fix for coverity bug #1721 which was due to the fix for coverity bug #943. r20685: Use HDstrncpy. --gh r20761: Purpose: Fix valgrind issues Description: Free image_data and data as appropriate in test_image. r20762: Purpose: Fix coverity issue 600 Description: Add check for return value of H5O_close in H5Ocopy. Also cleaned up various warnings. r20763: Purpose: Fix valgrind issues with h5stat Description: Modified h5stat to free "iter" before exit, and free "hand" before exit if parse_command_line exits directly. r20764: fixed coverity issues: 69, 327, 614, 684, 685, 696, 697, 1681, 967, 826, 660, 80 r20765: Fixed coverity bug 668 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program but I did add a check that n_elements is >= 1. I also changed an error condition from doing its own close and returning -1 to "goto out;" like the rest of the program. r20766: Fixed coverity bug 667 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program. Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (h5committest upcoming)
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 4be238d..98b169d 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -2049,7 +2049,11 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
#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);