-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OESS-168: Remove clang warnings. #1136
Conversation
test/swmr.c
Outdated
@@ -5220,7 +5220,7 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl) | |||
static int | |||
test_file_lock_swmr_concur(hid_t in_fapl) | |||
{ | |||
hid_t fid; /* File ID */ | |||
hid_t fid = -1; /* File ID */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of -1 use H5INVALID_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments in #1137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, as a rule, I initialize all IDs to H5I_INVALID_HID as it makes cleanup easier.
* TRILAB-266: Remove clang warnings in src/H5Zscaleoffset.c. (PR #1105) * Committing clang-format changes * TRILAB-266: Remove clang warnings in H5private.h and uthash.h. (PR #1124) * TRILAB-266: Remove clang warnings in H5FDcore.c. (PR #1127) * Committing clang-format changes * TRILAB-266: Remove clang warnings in test/testmeta.c. (PR #1135) * TRILAB-266: Remove clang warnings in test/swmr.c. (PR #1136) * TRILAB-266: Remove clang warnings in test/cork.c. (PR #1137) * Committing clang-format changes * TRILAB-266: Remove clang warnings in test/cork.c. (PR #1146) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This will remove
warning: variable 'fid' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
.