These patches fix some -Wmissing-variable-declarations warnings:

../../gllib/argp-ba.c:24:13: warning: no previous declaration for 
'argp_program_bug_address'
../../gllib/argp-pv.c:23:13: warning: no previous declaration for 
'argp_program_version'
../../gllib/bitset/array.c:628:22: warning: no previous declaration for 
'abitset_small_vtable'
../../gllib/bitset/array.c:666:22: warning: no previous declaration for 
'abitset_vtable'
../../gllib/bitset/list.c:1197:22: warning: no previous declaration for 
'lbitset_vtable'
../../gllib/bitset/stats.c:101:33: warning: no previous declaration for 
'bitset_stats_info_data'
../../gllib/bitset/stats.c:102:34: warning: no previous declaration for 
'bitset_stats_info'
../../gllib/bitset/stats.c:639:22: warning: no previous declaration for 
'bitset_stats_vtable'
../../gllib/bitset/table.c:1096:22: warning: no previous declaration for 
'tbitset_vtable'
../../gllib/bitset/vector.c:929:22: warning: no previous declaration for 
'vbitset_vtable'
../../gllib/ssfmalloc.h:506:18: warning: no previous declaration for 
'small_block_pages'
../../gllib/ssfmalloc.h:675:18: warning: no previous declaration for 
'medium_block_pages'


2025-04-26  Bruno Haible  <br...@clisp.org>

        ssfmalloc: Fix -Wmissing-variable-declarations warnings.
        * lib/ssfmalloc.h (small_block_pages, medium_block_pages): Make static.

        bitset: Fix -Wmissing-variable-declarations warnings.
        * lib/bitset/table.c (tbitset_vtable): Make static.
        * lib/bitset/array.c (abitset_small_vtable, abitset_vtable): Likewise.
        * lib/bitset/vector.c (vbitset_vtable): Likewise.
        * lib/bitset/list.c (lbitset_vtable): Likewise.
        * lib/bitset/stats.c (bitset_stats_info_data, bitset_stats_info,
        bitset_stats_vtable): Likewise.

        argp: Fix -Wmissing-variable-declarations warnings.
        * lib/argp-ba.c: Include <config.h> and argp.h.
        * lib/argp-pv.c: Likewise.

>From 1c5746941104fa91841b23cb77d24e482e9f3c27 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Sat, 26 Apr 2025 11:33:23 +0200
Subject: [PATCH 1/3] argp: Fix -Wmissing-variable-declarations warnings.

* lib/argp-ba.c: Include <config.h> and argp.h.
* lib/argp-pv.c: Likewise.
---
 ChangeLog     | 6 ++++++
 lib/argp-ba.c | 7 +++++++
 lib/argp-pv.c | 7 +++++++
 3 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 1e7d87b8ad..bbb145d907 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-26  Bruno Haible  <br...@clisp.org>
+
+	argp: Fix -Wmissing-variable-declarations warnings.
+	* lib/argp-ba.c: Include <config.h> and argp.h.
+	* lib/argp-pv.c: Likewise.
+
 2025-04-26  Bruno Haible  <br...@clisp.org>
 
 	vasnprintf: Fix -Wshadow=local warnings.
diff --git a/lib/argp-ba.c b/lib/argp-ba.c
index 66c0509886..7672573717 100644
--- a/lib/argp-ba.c
+++ b/lib/argp-ba.c
@@ -16,6 +16,13 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "argp.h"
+
 /* If set by the user program, it should point to string that is the
    bug-reporting address for the program.  It will be printed by argp_help if
    the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
diff --git a/lib/argp-pv.c b/lib/argp-pv.c
index 3059b8698e..1c76165b40 100644
--- a/lib/argp-pv.c
+++ b/lib/argp-pv.c
@@ -16,6 +16,13 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "argp.h"
+
 /* If set by the user program to a non-zero value, then a default option
    --version is added (unless the ARGP_NO_HELP flag is used), which will
    print this string followed by a newline and exit (unless the
-- 
2.43.0

>From cfcc6fb935f53a05bc799fc0f5fbc146bbbf45ca Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Sat, 26 Apr 2025 11:34:01 +0200
Subject: [PATCH 2/3] bitset: Fix -Wmissing-variable-declarations warnings.

* lib/bitset/table.c (tbitset_vtable): Make static.
* lib/bitset/array.c (abitset_small_vtable, abitset_vtable): Likewise.
* lib/bitset/vector.c (vbitset_vtable): Likewise.
* lib/bitset/list.c (lbitset_vtable): Likewise.
* lib/bitset/stats.c (bitset_stats_info_data, bitset_stats_info,
bitset_stats_vtable): Likewise.
---
 ChangeLog           | 8 ++++++++
 lib/bitset/array.c  | 4 ++--
 lib/bitset/list.c   | 2 +-
 lib/bitset/stats.c  | 6 +++---
 lib/bitset/table.c  | 2 +-
 lib/bitset/vector.c | 2 +-
 6 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bbb145d907..09b82bf7e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2025-04-26  Bruno Haible  <br...@clisp.org>
 
+	bitset: Fix -Wmissing-variable-declarations warnings.
+	* lib/bitset/table.c (tbitset_vtable): Make static.
+	* lib/bitset/array.c (abitset_small_vtable, abitset_vtable): Likewise.
+	* lib/bitset/vector.c (vbitset_vtable): Likewise.
+	* lib/bitset/list.c (lbitset_vtable): Likewise.
+	* lib/bitset/stats.c (bitset_stats_info_data, bitset_stats_info,
+	bitset_stats_vtable): Likewise.
+
 	argp: Fix -Wmissing-variable-declarations warnings.
 	* lib/argp-ba.c: Include <config.h> and argp.h.
 	* lib/argp-pv.c: Likewise.
diff --git a/lib/bitset/array.c b/lib/bitset/array.c
index e927aa9549..b796d0d190 100644
--- a/lib/bitset/array.c
+++ b/lib/bitset/array.c
@@ -625,7 +625,7 @@ abitset_copy (bitset dst, bitset src)
 
 
 /* Vector of operations for single word bitsets.  */
-struct bitset_vtable abitset_small_vtable = {
+static struct bitset_vtable abitset_small_vtable = {
   abitset_set,
   abitset_reset,
   bitset_toggle_,
@@ -663,7 +663,7 @@ struct bitset_vtable abitset_small_vtable = {
 
 
 /* Vector of operations for multiple word bitsets.  */
-struct bitset_vtable abitset_vtable = {
+static struct bitset_vtable abitset_vtable = {
   abitset_set,
   abitset_reset,
   bitset_toggle_,
diff --git a/lib/bitset/list.c b/lib/bitset/list.c
index 276c8d2c8e..15ac51945d 100644
--- a/lib/bitset/list.c
+++ b/lib/bitset/list.c
@@ -1194,7 +1194,7 @@ lbitset_xor (bitset dst, bitset src1, bitset src2)
 
 
 /* Vector of operations for linked-list bitsets.  */
-struct bitset_vtable lbitset_vtable = {
+static struct bitset_vtable lbitset_vtable = {
   lbitset_set,
   lbitset_reset,
   bitset_toggle_,
diff --git a/lib/bitset/stats.c b/lib/bitset/stats.c
index ba3d68cef8..ec1bf758bd 100644
--- a/lib/bitset/stats.c
+++ b/lib/bitset/stats.c
@@ -98,8 +98,8 @@ struct bitset_stats_info_struct
 };
 
 
-struct bitset_stats_info_struct bitset_stats_info_data;
-struct bitset_stats_info_struct *bitset_stats_info;
+static struct bitset_stats_info_struct bitset_stats_info_data;
+static struct bitset_stats_info_struct *bitset_stats_info;
 bool bitset_stats_enabled = false;
 
 
@@ -636,7 +636,7 @@ bitset_stats_free (bitset bset)
 }
 
 
-struct bitset_vtable bitset_stats_vtable = {
+static struct bitset_vtable bitset_stats_vtable = {
   bitset_stats_set,
   bitset_stats_reset,
   bitset_stats_toggle,
diff --git a/lib/bitset/table.c b/lib/bitset/table.c
index dd3343f836..615fa05841 100644
--- a/lib/bitset/table.c
+++ b/lib/bitset/table.c
@@ -1093,7 +1093,7 @@ tbitset_copy (bitset dst, bitset src)
 
 
 /* Vector of operations for linked-list bitsets.  */
-struct bitset_vtable tbitset_vtable = {
+static struct bitset_vtable tbitset_vtable = {
   tbitset_set,
   tbitset_reset,
   bitset_toggle_,
diff --git a/lib/bitset/vector.c b/lib/bitset/vector.c
index bdb7d006ff..e6f00a08ba 100644
--- a/lib/bitset/vector.c
+++ b/lib/bitset/vector.c
@@ -926,7 +926,7 @@ vbitset_free (bitset bset)
 
 
 /* Vector of operations for multiple word bitsets.  */
-struct bitset_vtable vbitset_vtable = {
+static struct bitset_vtable vbitset_vtable = {
   vbitset_set,
   vbitset_reset,
   bitset_toggle_,
-- 
2.43.0

>From b8934851bb7862e9d255405150278e219eb1e7df Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Sat, 26 Apr 2025 11:34:22 +0200
Subject: [PATCH 3/3] ssfmalloc: Fix -Wmissing-variable-declarations warnings.

* lib/ssfmalloc.h (small_block_pages, medium_block_pages): Make static.
---
 ChangeLog       | 3 +++
 lib/ssfmalloc.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 09b82bf7e8..ef3e097338 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-04-26  Bruno Haible  <br...@clisp.org>
 
+	ssfmalloc: Fix -Wmissing-variable-declarations warnings.
+	* lib/ssfmalloc.h (small_block_pages, medium_block_pages): Make static.
+
 	bitset: Fix -Wmissing-variable-declarations warnings.
 	* lib/bitset/table.c (tbitset_vtable): Make static.
 	* lib/bitset/array.c (abitset_small_vtable, abitset_vtable): Likewise.
diff --git a/lib/ssfmalloc.h b/lib/ssfmalloc.h
index cccc218300..ff05b997c9 100644
--- a/lib/ssfmalloc.h
+++ b/lib/ssfmalloc.h
@@ -503,7 +503,7 @@ free_small_block_in_page (uintptr_t block, uintptr_t page)
 }
 
 /* Management of pages of small blocks.  */
-struct page_pool small_block_pages =
+static struct page_pool small_block_pages =
   {
     init_small_block_page_pool,
     init_small_block_page,
@@ -672,7 +672,7 @@ free_medium_block_in_page (uintptr_t block, uintptr_t page)
 }
 
 /* Management of pages of medium blocks.  */
-struct page_pool medium_block_pages =
+static struct page_pool medium_block_pages =
   {
     init_medium_block_page_pool,
     init_medium_block_page,
-- 
2.43.0

Reply via email to