summaryrefslogtreecommitdiffstats
path: root/src/H5FDvfd_swmr.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-07-14 13:58:11 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-07-14 13:58:11 (GMT)
commitf7fab27b25c3b94b251c4d4f4181d5f75092f479 (patch)
tree24d8e9b938c921f2c3a9fd3a6e64e37055a4160d /src/H5FDvfd_swmr.c
parent12e5f29e48752b4fa9014fe9a0696e378225fcc3 (diff)
downloadhdf5-f7fab27b25c3b94b251c4d4f4181d5f75092f479.zip
hdf5-f7fab27b25c3b94b251c4d4f4181d5f75092f479.tar.gz
hdf5-f7fab27b25c3b94b251c4d4f4181d5f75092f479.tar.bz2
If the function-enter macro fails, return FAIL. Now the compiler can see that
if H5FD__vfd_swmr_header_deserialize() succeeds, then the header that was passed in was actually initialized. This squashes a used-before-initialized warning from GCC.
Diffstat (limited to 'src/H5FDvfd_swmr.c')
-rw-r--r--src/H5FDvfd_swmr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5FDvfd_swmr.c b/src/H5FDvfd_swmr.c
index f720606..b833fc8 100644
--- a/src/H5FDvfd_swmr.c
+++ b/src/H5FDvfd_swmr.c
@@ -1125,7 +1125,7 @@ H5FD__vfd_swmr_header_deserialize(H5FD_t *_file,
uint32_t stored_chksum; /* Stored metadata checksum */
uint32_t computed_chksum; /* Computed metadata checksum */
uint8_t *p;
- htri_t ret_value = TRUE;
+ htri_t ret_value = FAIL;
uint64_t index_length;
ssize_t nread;
@@ -1193,6 +1193,8 @@ H5FD__vfd_swmr_header_deserialize(H5FD_t *_file,
md_header->index_offset, md_header->index_length);
#endif /* JRM */
+ ret_value = TRUE;
+
done:
FUNC_LEAVE_NOAPI(ret_value)