summaryrefslogtreecommitdiffstats
path: root/src/H5RS.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5RS.c')
-rw-r--r--src/H5RS.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/H5RS.c b/src/H5RS.c
index d9915f2..16c2356 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -69,9 +69,6 @@ static herr_t H5RS__resize_for_append(H5RS_str_t *rs, size_t len);
/* Package Variables */
/*********************/
-/* Package initialization variable */
-hbool_t H5_PKG_INIT_VAR = FALSE;
-
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -316,8 +313,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 */
- ret_value->s = (char *)s;
+ /* 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_CLANG_DIAG_OFF("cast-qual")
+ ret_value->s = (char *)s;
+ H5_GCC_CLANG_DIAG_ON("cast-qual")
+
ret_value->len = HDstrlen(s);
ret_value->end = ret_value->s + ret_value->len;
@@ -345,7 +350,7 @@ done:
*/
/* Disable warning for "format not a string literal" here -QAK */
/*
- * This pragma only needs to surround the sprintf() calls with
+ * This pragma only needs to surround the snprintf() calls with
* format_templ in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
*/