Skip to content
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. #1124

Merged
merged 4 commits into from
Nov 5, 2021
Merged

Conversation

hyoklee
Copy link
Member

@hyoklee hyoklee commented Oct 20, 2021

Remove warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] from

  • H5checksum.c
  • H5Zshuffle.c
  • H5Shyper.c
  • H5Tref.c
  • H5Iint.c

src/H5private.h Outdated
@@ -252,7 +252,7 @@
#define H5_ATTR_NORETURN __attribute__((noreturn))
#define H5_ATTR_CONST __attribute__((const))
#define H5_ATTR_PURE __attribute__((pure))
#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__INTEL_COMPILER)
#if defined(__clang__) || defined(__GNUC__) && __GNUC__ >= 7 && !defined(__INTEL_COMPILER)
#define H5_ATTR_FALLTHROUGH __attribute__((fallthrough));
#else
#define H5_ATTR_FALLTHROUGH /*void*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't a lot of compilers respect a /* FALLTHROUGH */ comment? We might want to consider using that comment instead of /void/.

@@ -714,25 +714,35 @@ typedef unsigned char uint8_t;
hashv += (unsigned)(keylen); \
switch (_hj_k) { \
case 11: \
hashv += ((unsigned)_hj_key[10] << 24); /* FALLTHROUGH */ \
hashv += ((unsigned)_hj_key[10] << 24); \
H5_ATTR_FALLTHROUGH \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uthash is a file copied from an external repo. If it changes and we update it, we'll need to make sure these changes aren't lost.

@lrknox
Copy link
Collaborator

lrknox commented Oct 29, 2021

All Github checks passed after clang-format changes committed.
See https://github.com/HDFGroup/hdf5/actions/runs/1366190755.

@derobins
Copy link
Member

derobins commented Nov 2, 2021

Please change this to use /* FALLTHROUGH / instead of / void */ before merging. It's a trivial change and will help some compilers.

@lrknox lrknox merged commit a8d03d3 into HDFGroup:develop Nov 5, 2021
lrknox pushed a commit that referenced this pull request Nov 13, 2021
* 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>
@hyoklee hyoklee deleted the OESS-168-H5private branch July 14, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants