Various warning fixes (#1812)

* Fixed -Wreserved-id-macro warnings from header include guards

* Removed all __int64 and LL suffix stuff now that C99 is minimum requirement

* Rename `H5FD_CTL__` to `H5FD_CTL_` to fix -Wreserved-id-macro warnings

Double underscore is reserved in C++ and this public header should be C++ compatible.

* Never define __STDC_FORMAT_MACROS anymore

Defining it causes a -Wreserved-id-macro.

Happily, according to the C++11 standard:

"The macros defined by <stdint> are provided unconditionally. In particular, the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in C99 footnotes 219, 220, and 222) play no role in C++."

https://cplusplus.github.io/LWG/issue984

So looks like it's not necessary to define it with reasonably new toolchains.

* Fixed some -Wunused-macros warnings, removed dead code

* Fixed all -Wdouble-promotion warnings in C++ files

* Fixed remaining -Wsuggest-destructor-override warnings

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Sean McBride
2022-06-22 09:16:30 -07:00
committed by GitHub
co-authored by github-actions
parent 55f4cc0caa
commit 8b2e7b32b5
37 changed files with 143 additions and 304 deletions
+4 -4
View File
@@ -211,9 +211,9 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
/* Build default formats for long long types */
if (!fmt_llong[0]) {
if (HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH) < 0)
if (HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%lld") < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_convert: HDsnprintf failure");
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH) < 0)
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu") < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_convert: HDsnprintf failure");
} /* end if */
@@ -781,9 +781,9 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
/* Build default formats for long long types */
if (!fmt_llong[0]) {
if (HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH) < 0)
if (HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%lld") < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH) < 0)
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%llu") < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
} /* end if */
switch (tclass) {