mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit 'a83b6a7c6e6aca1a329c274282c691ffb417abc4': Moved H5PL diagnostic pragmas to comply with old gcc requirements that they be outside of functions.
This commit is contained in:
commit
3635cc24b0
@ -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
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
|
@ -250,6 +250,11 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/* See the other use of H5PL_GET_LIB_FUNC() for an explanation
|
||||
* for why we disable -Wpedantic here.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
herr_t
|
||||
H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info)
|
||||
{
|
||||
@ -276,16 +281,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f
|
||||
H5PL_get_plugin_info_t get_plugin_info_function;
|
||||
const H5Z_class2_t *filter_info;
|
||||
|
||||
/* Get the "get plugin info" function from the plugin.
|
||||
*
|
||||
* See the other use of H5PL_GET_LIB_FUNC() for an explanation
|
||||
* for why we disable -Wpedantic here.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
/* Get the "get plugin info" function from the plugin. */
|
||||
if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info")))
|
||||
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info")
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Call the "get plugin info" function */
|
||||
if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)()))
|
||||
@ -305,4 +303,5 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5PL__find_plugin_in_cache() */
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user