]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stdcountof-h-tests: pacify -Wnested-externs
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Jan 2026 16:02:42 +0000 (08:02 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Jan 2026 16:11:40 +0000 (08:11 -0800)
* tests/test-stdcountof-h.c (test_func): Use top-level non-constant.

ChangeLog
tests/test-stdcountof-h.c

index 8ce452f50d0fa154d914872bc01857691bae7629..c857f372bbd2626b6f0585b842f8768c3e30499a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2026-01-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+       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
index 0b4c4cc15ff474baae576d1153826765428ff7a5..191ba5c7796ba1604dc553a8b3e6798b628ce0fb 100644 (file)
@@ -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