Skip to content

Commit

Permalink
Turn on -Werror for Java in GitHub -Werror workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Mar 26, 2024
1 parent cb3169f commit 8c74a41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main-auto-spc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@ jobs:
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
CFLAGS=-Werror $GITHUB_WORKSPACE/configure \
CFLAGS=-Werror JAVACFLAGS=-Werror JNIFLAGS=-Werror \
$GITHUB_WORKSPACE/configure \
--enable-build-mode=debug \
--enable-warnings-as-errors \
--enable-deprecated-symbols \
--with-default-api-version=v114 \
--enable-shared \
Expand Down Expand Up @@ -478,8 +480,10 @@ jobs:
sh ./autogen.sh
mkdir "${{ runner.workspace }}/build"
cd "${{ runner.workspace }}/build"
CFLAGS=-Werror $GITHUB_WORKSPACE/configure \
CFLAGS=-Werror JAVACFLAGS=-Werror JNIFLAGS=-Werror \
$GITHUB_WORKSPACE/configure \
--enable-build-mode=production \
--enable-warnings-as-errors \
--enable-deprecated-symbols \
--with-default-api-version=v114 \
--enable-shared \
Expand Down
6 changes: 3 additions & 3 deletions java/src/jni/h5aImp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,12 @@ Java_hdf_hdf5lib_H5_H5Awrite_1string(JNIEnv *env, jclass clss, jlong attr_id, jl
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5AreadVL(JNIEnv *env, jclass clss, jlong attr_id, jlong mem_type_id, jobjectArray buf)
{
void *readBuf = NULL;
jbyte *readBuf = NULL;
hsize_t dims[H5S_MAX_RANK];
hid_t sid = H5I_INVALID_HID;
size_t typeSize;
H5T_class_t type_class;
jsize vl_array_len = 0;
jsize vl_array_len;
htri_t vl_data_class;
herr_t status = FAIL;
htri_t is_variable = 0;
Expand All @@ -1136,7 +1136,7 @@ Java_hdf_hdf5lib_H5_H5AreadVL(JNIEnv *env, jclass clss, jlong attr_id, jlong mem
if (NULL == (readBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread: failed to allocate raw VL read buffer");

if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, readBuf)) < 0)
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, (void *)readBuf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if ((type_class = H5Tget_class((hid_t)mem_type_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
Expand Down

0 comments on commit 8c74a41

Please sign in to comment.