Modified gcc/clang warning suppression macros to account for some warnings flags being supported by one compiler but not the other (#379)

* Committing clang-format changes

* Fixed GCC warning suppression pragmas to also work with clang

H5_GCC_DIAG_ON remains gcc-only.

Added a new H5_CLANG_DIAG_ON that's clang-only, but it's not used anywhere currently.

Added a new H5_GCC_CLANG_DIAG_ON that works with both compilers, which afterall support mostly the same warnings.  Changed almost all uses of H5_GCC_DIAG_ON to use H5_GCC_CLANG_DIAG_ON, with the exception of a couple, where they really were suppressing gcc-only 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
2021-09-16 08:42:20 -04:00
committed by GitHub
parent 1c892fb41f
commit 1f2bba5255
19 changed files with 161 additions and 133 deletions

View File

@@ -26,8 +26,8 @@ extern "C" {
#include <stdlib.h>
#include "h5jni.h"
H5_GCC_DIAG_OFF("missing-prototypes")
H5_GCC_DIAG_OFF("unused-parameter")
H5_GCC_CLANG_DIAG_OFF("missing-prototypes")
H5_GCC_CLANG_DIAG_OFF("unused-parameter")
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls)
@@ -1212,7 +1212,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1FAIL(JNIEnv *env, jclass cls)
}
/* Java does not have unsigned native types */
H5_GCC_DIAG_OFF("sign-conversion")
H5_GCC_CLANG_DIAG_OFF("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls)
{
@@ -1253,7 +1253,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls)
{
return H5F_ACC_SWMR_WRITE;
}
H5_GCC_DIAG_ON("sign-conversion")
H5_GCC_CLANG_DIAG_ON("sign-conversion")
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls)
@@ -3724,8 +3724,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls)
return H5Z_FILTER_ALL;
}
H5_GCC_DIAG_ON("missing-prototypes")
H5_GCC_DIAG_ON("unused-parameter")
H5_GCC_CLANG_DIAG_ON("missing-prototypes")
H5_GCC_CLANG_DIAG_ON("unused-parameter")
#ifdef __cplusplus
} /* end extern "C" */