Skip to content

Commit

Permalink
Quiets const warning in H5RS code (HDFGroup#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored and jhendersonHDF committed May 3, 2022
1 parent e01e1ce commit 2be6e9e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/H5RS.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,16 @@ H5RS_wrap(const char *s)
if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t)))
HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, NULL, "memory allocation failed")

/* Set the internal fields */
/* Set the internal fields
*
* We ignore warnings about storing a const char pointer in the struct
* since we never modify or free the string when the wrapped struct
* field is set to TRUE.
*/
H5_GCC_DIAG_OFF("cast-qual")
ret_value->s = (char *)s;
H5_GCC_DIAG_ON("cast-qual")

ret_value->wrapped = 1;
ret_value->n = 1;

Expand Down

0 comments on commit 2be6e9e

Please sign in to comment.