summaryrefslogtreecommitdiffstats
path: root/src/H5PLint.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-08-02 15:32:31 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-08-02 15:32:31 (GMT)
commit81340c609ba5049b34845ff2f06b2025ec5d5b22 (patch)
tree1664d97cbf11b35800b32864fa1bb55d377761f1 /src/H5PLint.c
parent8b8e7ae23222387e14ba95a53e0ab4d10cc8687f (diff)
downloadhdf5-81340c609ba5049b34845ff2f06b2025ec5d5b22.zip
hdf5-81340c609ba5049b34845ff2f06b2025ec5d5b22.tar.gz
hdf5-81340c609ba5049b34845ff2f06b2025ec5d5b22.tar.bz2
Moved H5PL diagnostic pragmas to comply with old gcc requirements that they
be outside of functions.
Diffstat (limited to 'src/H5PLint.c')
-rw-r--r--src/H5PLint.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5PLint.c b/src/H5PLint.c
index bd6bf7d..c887f86 100644
--- a/src/H5PLint.c
+++ b/src/H5PLint.c
@@ -292,6 +292,17 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting
+ * object pointers to function pointers, which is undefined in ANSI C.
+ * This is basically unavoidable due to the nature of dlsym() and *is*
+ * defined in POSIX, so it's fine.
+ *
+ * This pragma only needs to surround the assignment of the
+ * get_plugin_info function pointer, but early (4.4.7, at least) gcc
+ * only allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
herr_t
H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const void **plugin_info)
{
@@ -318,19 +329,10 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v
HGOTO_DONE(SUCCEED);
}
-
/* Return a handle for the function H5PLget_plugin_info in the dynamic library.
* The plugin library is suppose to define this function.
- *
- * NOTE: We turn off -Wpedantic in gcc to quiet a warning about converting
- * object pointers to function pointers, which is undefined in ANSI C.
- * This is basically unavoidable due to the nature of dlsym() and *is*
- * defined in POSIX, so it's fine.
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) {
-#pragma GCC diagnostic pop
const H5Z_class2_t *info;
@@ -358,6 +360,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PL__open() */
+#pragma GCC diagnostic pop
/*-------------------------------------------------------------------------