]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stdcountof-h tests: Fix link error on MSVC (regression 2026-01-13).
authorBruno Haible <bruno@clisp.org>
Thu, 15 Jan 2026 13:24:53 +0000 (14:24 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Jan 2026 13:24:53 +0000 (14:24 +0100)
* tests/test-stdcountof-h.c: Revert 2026-01-13 change. Instead:
(a, b, c): Declare extern at top level.

ChangeLog
tests/test-stdcountof-h.c

index 419dfec25dda51461299c0e3e8d0d04deedcf069..7d7d0f6f501b6ec3e27b53a7290d54217a157921 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-01-15  Bruno Haible  <bruno@clisp.org>
+
+       stdcountof-h tests: Fix link error on MSVC (regression 2026-01-13).
+       * tests/test-stdcountof-h.c: Revert 2026-01-13 change. Instead:
+       (a, b, c): Declare extern at top level.
+
 2026-01-14  Bruno Haible  <bruno@clisp.org>
 
        stdcountof-h tests: Avoid compilation error in C++ mode.
index 03498ae99dcc041bf17b6c92c728e83185caec7a..07a86fef98ff834bec425e1c3953d655fc614b94 100644 (file)
@@ -34,6 +34,7 @@ extern int integer;
 extern int unbounded[];
 extern int bounded[10];
 extern int multidimensional[10][20];
+extern int a, b, c;
 
 static void
 test_func (int parameter[3])
@@ -81,8 +82,8 @@ test_func (int parameter[3])
   /* Avoid MSVC C++ error C4576 "a parenthesized type followed by an
      initializer list is a non-standard explicit type conversion syntax".  */
 #if !defined __cplusplus
-  ASSERT (countof ((int[]) { integer, integer, integer }) == 3);
-  ASSERT (countof (((int[]) { integer, integer, integer })) == 3);
+  ASSERT (countof ((int[]) { a, b, c }) == 3);
+  ASSERT (countof (((int[]) { a, b, c })) == 3);
 #endif
 
   /* Check that countof(...) is an expression of type size_t.  */