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. #1129

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/h5test.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
\
ARR = (TYPE **)HDmalloc(h5taa_pointers_size + h5taa_data_size); \
\
ARR[0] = (TYPE *)(ARR + (DIMS_I)); \
ARR[0] = (void *)(ARR + (DIMS_I)); \
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a place where the warning is easy to suppress but the alignment may still be wrong.

I believe DIMS_I and DIMS_J are constant. If so, then you can malloc a struct { TYPE *rows[DIMS_I]; TYPE values[DIMS_I * DIMS_J]; } *prototype;, initialize all DIMS_I pointers in rows, and then set ARR to &prototype->rows[0].

Copy link
Member

Choose a reason for hiding this comment

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

As in #1130, I agree with Dave. Casting to a void pointer to make the compiler quiet is probably not the best fix here.

\
for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \
ARR[h5taa_i] = ARR[h5taa_i - 1] + (DIMS_J); \
Expand Down