summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-19 15:38:02 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-02-19 15:38:02 (GMT)
commit7b4131c2ae997f8e870ed57a9fca2f7f6d3ea233 (patch)
tree39039e0a303502b831ca50305661ad714221d66d /src
parent47b79b7422c91e53ae5d87bcda45d52798a64fb6 (diff)
parent50aac126d7c4082c2aeb0f3a68cad26bd1cd9783 (diff)
downloadhdf5-7b4131c2ae997f8e870ed57a9fca2f7f6d3ea233.zip
hdf5-7b4131c2ae997f8e870ed57a9fca2f7f6d3ea233.tar.gz
hdf5-7b4131c2ae997f8e870ed57a9fca2f7f6d3ea233.tar.bz2
Merge pull request #2367 in HDFFV/hdf5 from ~DYOUNG/werror:unused to develop
* commit '50aac126d7c4082c2aeb0f3a68cad26bd1cd9783': Start to document the function/parameter/variable attribute macros. Filter all of the new _USED / _UNUSED type modifiers. H5_HAVE_PARALLEL, _DEBUG_API, etc. Add attributes to some variables and parameters that are unused under some configurations.
Diffstat (limited to 'src')
-rw-r--r--src/H5B2leaf.c2
-rw-r--r--src/H5I.c3
-rw-r--r--src/H5Odbg.c4
-rw-r--r--src/H5Pfapl.c3
-rw-r--r--src/H5VLnative_attr.c3
-rw-r--r--src/H5VLnative_group.c5
-rw-r--r--src/H5Z.c3
-rw-r--r--src/H5private.h53
8 files changed, 53 insertions, 23 deletions
diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c
index 7ed0468..c1221ba 100644
--- a/src/H5B2leaf.c
+++ b/src/H5B2leaf.c
@@ -1051,7 +1051,7 @@ H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr,
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE herr_t
-H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, const H5B2_leaf_t H5_ATTR_UNUSED *leaf2)
+H5B2__assert_leaf2(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf, const H5B2_leaf_t H5_ATTR_UNUSED *leaf2)
{
/* General sanity checking on node */
HDassert(leaf->nrec <= hdr->node_info->split_nrec);
diff --git a/src/H5I.c b/src/H5I.c
index 2ba8a2a..b233d23 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -215,7 +215,8 @@ H5I_term_package(void)
*-------------------------------------------------------------------------
*/
H5I_type_t
-H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func)
+H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved,
+ H5I_free_t free_func)
{
H5I_class_t *cls = NULL; /* New ID class */
H5I_type_t new_type; /* New ID type value */
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index b8190ae..3c91cae 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -153,7 +153,7 @@ H5O__assert(const H5O_t *oh)
/* Loop over all messages in object header */
for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) {
- uint8_t *curr_hdr; /* Start of current message header */
+ uint8_t H5_ATTR_NDEBUG_UNUSED *curr_hdr; /* Start of current message header */
size_t curr_tot_size; /* Total size of current message (including header) */
curr_hdr = curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh);
@@ -164,7 +164,7 @@ H5O__assert(const H5O_t *oh)
free_space += curr_tot_size;
else if(H5O_CONT_ID == curr_msg->type->id) {
H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native;
- hbool_t found_chunk = FALSE; /* Found a chunk that matches */
+ hbool_t H5_ATTR_NDEBUG_UNUSED found_chunk = FALSE; /* Found a chunk that matches */
HDassert(cont);
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 9a04c3e..7866464 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -4479,7 +4479,8 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close)
+H5Pset_evict_on_close(hid_t fapl_id,
+ hbool_t H5_ATTR_PARALLEL_UNUSED evict_on_close)
{
H5P_genplist_t *plist; /* property list pointer */
herr_t ret_value = SUCCEED; /* return value */
diff --git a/src/H5VLnative_attr.c b/src/H5VLnative_attr.c
index e54c49f..8072cd5 100644
--- a/src/H5VLnative_attr.c
+++ b/src/H5VLnative_attr.c
@@ -525,7 +525,8 @@ done:
*/
herr_t
H5VL__native_attr_optional(void H5_ATTR_UNUSED *obj, H5VL_attr_optional_t opt_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+ hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req,
+ va_list H5_ATTR_DEPRECATED_USED arguments)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5VLnative_group.c b/src/H5VLnative_group.c
index 3fdb2d9..236ee9d 100644
--- a/src/H5VLnative_group.c
+++ b/src/H5VLnative_group.c
@@ -266,8 +266,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_group_optional(void *obj, H5VL_group_optional_t optional_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+H5VL__native_group_optional(void H5_ATTR_UNUSED *obj,
+ H5VL_group_optional_t optional_type, hid_t H5_ATTR_UNUSED dxpl_id,
+ void H5_ATTR_UNUSED **req, va_list H5_ATTR_DEPRECATED_USED arguments)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Z.c b/src/H5Z.c
index 53186f1..2f477a3 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -585,7 +585,8 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key)
+H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id,
+ void *key H5_ATTR_PARALLEL_USED)
{
H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5private.h b/src/H5private.h
index 700fe8a..3759446 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -304,17 +304,38 @@
* file). Be sure to update that file if the #ifdefs change here.
*/
#ifdef __cplusplus
-# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NDEBUG_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
-# define H5_ATTR_CONST /*void*/
-# define H5_ATTR_PURE /*void*/
-# define H5_ATTR_FALLTHROUGH /*void*/
+# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_DEPRECATED_USED /*void*/
+# define H5_ATTR_NDEBUG_UNUSED /*void*/
+# define H5_ATTR_DEBUG_API_USED /*void*/
+# define H5_ATTR_PARALLEL_UNUSED /*void*/
+# define H5_ATTR_PARALLEL_USED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
+# define H5_ATTR_FALLTHROUGH /*void*/
#else /* __cplusplus */
#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C)
# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z)))
# define H5_ATTR_UNUSED __attribute__((unused))
+#ifdef H5_HAVE_PARALLEL
+# define H5_ATTR_PARALLEL_UNUSED __attribute__((unused))
+# define H5_ATTR_PARALLEL_USED /*void*/
+#else
+# define H5_ATTR_PARALLEL_UNUSED /*void*/
+# define H5_ATTR_PARALLEL_USED __attribute__((unused))
+#endif
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+#define H5_ATTR_DEPRECATED_USED H5_ATTR_UNUSED
+#else /* H5_NO_DEPRECATED_SYMBOLS */
+#define H5_ATTR_DEPRECATED_USED /*void*/
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+#ifdef H5_DEBUG_API
+#define H5_ATTR_DEBUG_API_USED /*void*/
+#else /* H5_DEBUG_API */
+#define H5_ATTR_DEBUG_API_USED H5_ATTR_UNUSED
+#endif /* H5_DEBUG_API */
#ifndef NDEBUG
#define H5_ATTR_NDEBUG_UNUSED /*void*/
#else /* NDEBUG */
@@ -329,13 +350,17 @@
# define H5_ATTR_FALLTHROUGH /*void*/
#endif
#else
-# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NDEBUG_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
-# define H5_ATTR_CONST /*void*/
-# define H5_ATTR_PURE /*void*/
-# define H5_ATTR_FALLTHROUGH /*void*/
+# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_NDEBUG_UNUSED /*void*/
+# define H5_ATTR_DEBUG_API_USED /*void*/
+# define H5_ATTR_DEPRECATED_USED /*void*/
+# define H5_ATTR_PARALLEL_UNUSED /*void*/
+# define H5_ATTR_PARALLEL_USED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
+# define H5_ATTR_FALLTHROUGH /*void*/
#endif
#endif /* __cplusplus */