diff --git a/config/gnu-warnings/error-general b/config/gnu-warnings/error-general index 4358b2064dc..8405c401103 100644 --- a/config/gnu-warnings/error-general +++ b/config/gnu-warnings/error-general @@ -3,7 +3,6 @@ # circumstances, so ask the compiler to treat them as errors: # -Werror=bad-function-cast --Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=missing-prototypes diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general index e19014f473b..31194d3ba43 100644 --- a/config/gnu-warnings/noerror-general +++ b/config/gnu-warnings/noerror-general @@ -3,7 +3,6 @@ # circumstances, so ask the compiler to treat them as errors: # -Wbad-function-cast --Wdeclaration-after-statement -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-prototypes diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 65da9d03df7..875a37a9eed 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -916,7 +916,7 @@ char *yytext; #include "H5LTparse.h" static char *trim_quotes(const char *); -int my_yyinput(char *, int); +static int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) #define token(x) (int)x @@ -2554,7 +2554,7 @@ trim_quotes(const char *quoted) return trimmed; } -int my_yyinput(char *buf, int max_size) +static int my_yyinput(char *buf, int max_size) { int ret; diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index fd1cbe59d6b..50066126fbf 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -27,7 +27,7 @@ #include "H5LTparse.h" static char *trim_quotes(const char *); -int my_yyinput(char *, int); +static int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) #define token(x) (int)x @@ -144,7 +144,7 @@ trim_quotes(const char *quoted) return trimmed; } -int my_yyinput(char *buf, int max_size) +static int my_yyinput(char *buf, int max_size) { int ret; diff --git a/release_docs/INSTALL_Warnings.txt b/release_docs/INSTALL_Warnings.txt index 97b3f766b24..97981be5ba6 100644 --- a/release_docs/INSTALL_Warnings.txt +++ b/release_docs/INSTALL_Warnings.txt @@ -60,7 +60,6 @@ Autotools UNIX warnings added to H5_CFLAGS -Wcast-align -Wcast-qual -Wconversion - -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal -Wformat=2 @@ -291,7 +290,6 @@ IF GNU GCC -Wcast-align -Wcast-qual -Wconversion - -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal -Wformat=2 diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index 731d741d650..18323ca74e9 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -118,32 +118,32 @@ static herr_t H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_ /* Note that there's no cache set up call since that's the * place where this struct is wired into the cache. */ -static H5C_log_class_t H5C_json_log_class_g = {"json", - H5C__json_tear_down_logging, - NULL, /* start logging */ - NULL, /* stop logging */ - H5C__json_write_start_log_msg, - H5C__json_write_stop_log_msg, - H5C__json_write_create_cache_log_msg, - H5C__json_write_destroy_cache_log_msg, - H5C__json_write_evict_cache_log_msg, - H5C__json_write_expunge_entry_log_msg, - H5C__json_write_flush_cache_log_msg, - H5C__json_write_insert_entry_log_msg, - H5C__json_write_mark_entry_dirty_log_msg, - H5C__json_write_mark_entry_clean_log_msg, - H5C__json_write_mark_unserialized_entry_log_msg, - H5C__json_write_mark_serialized_entry_log_msg, - H5C__json_write_move_entry_log_msg, - H5C__json_write_pin_entry_log_msg, - H5C__json_write_create_fd_log_msg, - H5C__json_write_protect_entry_log_msg, - H5C__json_write_resize_entry_log_msg, - H5C__json_write_unpin_entry_log_msg, - H5C__json_write_destroy_fd_log_msg, - H5C__json_write_unprotect_entry_log_msg, - H5C__json_write_set_cache_config_log_msg, - H5C__json_write_remove_entry_log_msg}; +static const H5C_log_class_t H5C_json_log_class_g = {"json", + H5C__json_tear_down_logging, + NULL, /* start logging */ + NULL, /* stop logging */ + H5C__json_write_start_log_msg, + H5C__json_write_stop_log_msg, + H5C__json_write_create_cache_log_msg, + H5C__json_write_destroy_cache_log_msg, + H5C__json_write_evict_cache_log_msg, + H5C__json_write_expunge_entry_log_msg, + H5C__json_write_flush_cache_log_msg, + H5C__json_write_insert_entry_log_msg, + H5C__json_write_mark_entry_dirty_log_msg, + H5C__json_write_mark_entry_clean_log_msg, + H5C__json_write_mark_unserialized_entry_log_msg, + H5C__json_write_mark_serialized_entry_log_msg, + H5C__json_write_move_entry_log_msg, + H5C__json_write_pin_entry_log_msg, + H5C__json_write_create_fd_log_msg, + H5C__json_write_protect_entry_log_msg, + H5C__json_write_resize_entry_log_msg, + H5C__json_write_unpin_entry_log_msg, + H5C__json_write_destroy_fd_log_msg, + H5C__json_write_unprotect_entry_log_msg, + H5C__json_write_set_cache_config_log_msg, + H5C__json_write_remove_entry_log_msg}; /*------------------------------------------------------------------------- * Function: H5C__json_write_log_message diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index c30f79e3e6a..d33d1b05a65 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -113,32 +113,32 @@ static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache /* Note that there's no cache set up call since that's the * place where this struct is wired into the cache. */ -static H5C_log_class_t H5C_trace_log_class_g = {"trace", - H5C__trace_tear_down_logging, - NULL, /* start logging */ - NULL, /* stop logging */ - NULL, /* write start message */ - NULL, /* write stop message */ - NULL, /* write create cache message */ - NULL, /* write destroy cache message */ - NULL, /* write evict cache message */ - H5C__trace_write_expunge_entry_log_msg, - H5C__trace_write_flush_cache_log_msg, - H5C__trace_write_insert_entry_log_msg, - H5C__trace_write_mark_entry_dirty_log_msg, - H5C__trace_write_mark_entry_clean_log_msg, - H5C__trace_write_mark_unserialized_entry_log_msg, - H5C__trace_write_mark_serialized_entry_log_msg, - H5C__trace_write_move_entry_log_msg, - H5C__trace_write_pin_entry_log_msg, - H5C__trace_write_create_fd_log_msg, - H5C__trace_write_protect_entry_log_msg, - H5C__trace_write_resize_entry_log_msg, - H5C__trace_write_unpin_entry_log_msg, - H5C__trace_write_destroy_fd_log_msg, - H5C__trace_write_unprotect_entry_log_msg, - H5C__trace_write_set_cache_config_log_msg, - H5C__trace_write_remove_entry_log_msg}; +static const H5C_log_class_t H5C_trace_log_class_g = {"trace", + H5C__trace_tear_down_logging, + NULL, /* start logging */ + NULL, /* stop logging */ + NULL, /* write start message */ + NULL, /* write stop message */ + NULL, /* write create cache message */ + NULL, /* write destroy cache message */ + NULL, /* write evict cache message */ + H5C__trace_write_expunge_entry_log_msg, + H5C__trace_write_flush_cache_log_msg, + H5C__trace_write_insert_entry_log_msg, + H5C__trace_write_mark_entry_dirty_log_msg, + H5C__trace_write_mark_entry_clean_log_msg, + H5C__trace_write_mark_unserialized_entry_log_msg, + H5C__trace_write_mark_serialized_entry_log_msg, + H5C__trace_write_move_entry_log_msg, + H5C__trace_write_pin_entry_log_msg, + H5C__trace_write_create_fd_log_msg, + H5C__trace_write_protect_entry_log_msg, + H5C__trace_write_resize_entry_log_msg, + H5C__trace_write_unpin_entry_log_msg, + H5C__trace_write_destroy_fd_log_msg, + H5C__trace_write_unprotect_entry_log_msg, + H5C__trace_write_set_cache_config_log_msg, + H5C__trace_write_remove_entry_log_msg}; /*------------------------------------------------------------------------- * Function: H5C__trace_write_log_message diff --git a/src/H5MF.c b/src/H5MF.c index 7f814ba3218..b7004c14a62 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1442,13 +1442,13 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) { - H5MF_free_section_t * node = NULL; /* Free space section pointer */ - H5MF_sect_ud_t udata; /* User data for callback */ - H5FS_section_class_t *sect_cls; /* Section class */ - H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */ - H5F_mem_page_t fs_type; /* Free space type */ - htri_t ret_value = FALSE; /* Return value */ + H5MF_free_section_t * node = NULL; /* Free space section pointer */ + H5MF_sect_ud_t udata; /* User data for callback */ + const H5FS_section_class_t *sect_cls; /* Section class */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */ + H5F_mem_page_t fs_type; /* Free space type */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index 4e7717ddffb..f34c73e1764 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -168,9 +168,9 @@ typedef struct H5MF_fs_t { /*****************************/ /* H5MF single section inherits serializable properties from H5FS_section_class_t */ -H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1]; -H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1]; -H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1]; +H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1]; +H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1]; +H5_DLLVAR const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1]; /******************************/ /* Package Private Prototypes */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 8d4704ea074..bf5b88892cb 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -81,7 +81,7 @@ static herr_t H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *udata); /*********************/ /* Class info for "simple" free space sections */ -H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ +const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ /* Class variables */ H5MF_FSPACE_SECT_SIMPLE, /* Section type */ 0, /* Extra serialized size */ @@ -107,7 +107,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{ }}; /* Class info for "small" free space sections */ -H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ +const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ /* Class variables */ H5MF_FSPACE_SECT_SMALL, /* Section type */ 0, /* Extra serialized size */ @@ -133,7 +133,7 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ }}; /* Class info for "large" free space sections */ -H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ +const H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{ /* Class variables */ H5MF_FSPACE_SECT_LARGE, /* Section type */ 0, /* Extra serialized size */