* tests/test-stdcountof-h.c (test_func): Use top-level non-constant.
---
 ChangeLog                 | 3 +++
 tests/test-stdcountof-h.c | 7 ++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8ce452f50d..c857f372bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2026-01-13  Paul Eggert  <[email protected]>
 
+       stdcountof-h-tests: pacify -Wnested-externs
+       * tests/test-stdcountof-h.c (test_func): Use top-level non-constant.
+
        isinf-no-c++-tests: pacify -Wshadow
        * tests/test-isinf.c (mem_long_double): Rename this local type
        from memory_long_double, to avoid confusion with the top-level
diff --git a/tests/test-stdcountof-h.c b/tests/test-stdcountof-h.c
index 0b4c4cc15f..191ba5c779 100644
--- a/tests/test-stdcountof-h.c
+++ b/tests/test-stdcountof-h.c
@@ -78,11 +78,8 @@ test_func (int parameter[3])
   ASSERT (countof (unbounded) >= 0);
 #endif
 
-  {
-    extern int a, b, c;
-    ASSERT (countof ((int[]) { a, b, c }) == 3);
-    ASSERT (countof (((int[]) { a, b, c })) == 3);
-  }
+  ASSERT (countof ((int[]) { integer, integer, integer }) == 3);
+  ASSERT (countof (((int[]) { integer, integer, integer })) == 3);
 
   /* Check that countof(...) is an expression of type size_t.  */
 #if !defined __cplusplus && HAVE__GENERIC
-- 
2.51.0


Reply via email to