diff options
author | David Young <dyoung@hdfgroup.org> | 2022-05-06 23:26:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 23:26:48 (GMT) |
commit | 779ab44aa03aa351f01bddbfc4a565aebdcc15ae (patch) | |
tree | e92d760f5517d171c0689195910bfbc27d3a1786 /src | |
parent | ca737ece9acd8168d9df4a08c9907a294053a883 (diff) | |
download | hdf5-779ab44aa03aa351f01bddbfc4a565aebdcc15ae.zip hdf5-779ab44aa03aa351f01bddbfc4a565aebdcc15ae.tar.gz hdf5-779ab44aa03aa351f01bddbfc4a565aebdcc15ae.tar.bz2 |
Re-promote some GNU warnings to errors (#1508)
* Promote some GCC warnings back to errors and deal with build breakage.
I tested configuring and building with GCC 8.3.0 with
`.../configure --prefix=$HOME/wrk/install/manydsets --enable-build-mode=production --enable-symbols=-gdwarf-4 --enable-warnings-as-errors --enable-java --enable-hl --enable-fortran --enable-cxx --enable-mirror-vfd --enable-ros3-vfd --enable-direct-vfd`
and with the same options but `--enable-build-mode=debug`.
* Promote -Wrestrict to -Werror=restrict to help catch overlapping
arguments to strcpy, memcpy, et cetera, at compile time.
* NFCI: sort lines.
* Committing clang-format changes
* NFCI: remove whitespace at EOL.
* Re-use temporary variable `shared`.
* Remove merge oopsie.
* Mention that no op codes are understood per review comment.
* Change this back to the develop branch's way, since this change isn't
integral to the PR.
* Committing clang-format changes
* NFCI: reduce differences with `develop` branch in the hope that that
also kicks off CI.
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDsec2.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index aabee0f..acc705e 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -1075,20 +1075,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__sec2_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags, +H5FD__sec2_ctl(H5FD_t *_file, uint64_t H5_ATTR_UNUSED op_code, uint64_t flags, const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output) { herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE - switch (op_code) { - /* Unknown op code */ - default: - if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) - HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set") - break; - } + /* Sanity checks */ + HDassert(_file); + + /* No op codes are understood. */ + if (flags & H5FD_CTL__FAIL_IF_UNKNOWN_FLAG) + HGOTO_ERROR(H5E_VFL, H5E_FCNTL, FAIL, "unknown op_code and fail if unknown flag is set") done: FUNC_LEAVE_NOAPI(ret_value) |