]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stdcountof-tests: pacify ODS 12.6
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Oct 2025 20:38:08 +0000 (13:38 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Oct 2025 20:38:08 +0000 (13:38 -0700)
* tests/test-stdcountof-h.c (test_func) [__SUNPRO_C]: Omit tests
involving u"xxx" and u8"...", as Oracle Developer Studio 12.6
lacks support for this despite claiming C11 conformance.
(a, b, c) [__SUNPRO_C]: Define; ODS 12.6 has the same bug as MSVC 14.

ChangeLog
tests/test-stdcountof-h.c

index a1228c2cd1d0d71e1103489eb2651fd6f5f550ef..bac7f4919f618079b4f2e0a8b8597d3664230722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-10-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdcountof-tests: pacify ODS 12.6
+       * tests/test-stdcountof-h.c (test_func) [__SUNPRO_C]: Omit tests
+       involving u"xxx" and u8"...", as Oracle Developer Studio 12.6
+       lacks support for this despite claiming C11 conformance.
+       (a, b, c) [__SUNPRO_C]: Define; ODS 12.6 has the same bug as MSVC 14.
+
 2025-10-23  Bruno Haible  <bruno@clisp.org>
 
        stdioext: Add support for OpenBSD >= 7.8.
index 615cccda16240c787eb19443d36a2f528b339752..42f2f825377243cf655514090f0f9115253b72d7 100644 (file)
@@ -48,7 +48,8 @@ test_func (int parameter[3])
   (void) _gl_verify_is_array (multidimensional);
   (void) _gl_verify_is_array ("string");
   (void) _gl_verify_is_array (L"wide string");
-# if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+# if ((__STDC_VERSION__ >= 201112L || __cplusplus >= 201103L) \
+      && !defined __SUNPRO_C)
   (void) _gl_verify_is_array (u8"UTF-8 string");
   (void) _gl_verify_is_array (u"UTF-16 string");
   (void) _gl_verify_is_array (U"UTF-32 string");
@@ -60,7 +61,8 @@ test_func (int parameter[3])
   ASSERT (countof (local_bounded) == 20);
   ASSERT (countof ("string") == 6 + 1);
   ASSERT (countof (L"wide string") == 11 + 1);
-#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+# if ((__STDC_VERSION__ >= 201112L || __cplusplus >= 201103L) \
+      && !defined __SUNPRO_C)
   ASSERT (countof (u8"UTF-8 string") == 12 + 1);
   ASSERT (countof (u"UTF-16 string") == 13 + 1);
   ASSERT (countof (U"UTF-32 string") == 13 + 1);
@@ -88,7 +90,7 @@ test_func (int parameter[3])
   ASSERT (_Generic (countof (local_bounded),    size_t: 1, default: 0));
   ASSERT (_Generic (countof ("string"),         size_t: 1, default: 0));
   ASSERT (_Generic (countof (L"wide string"),   size_t: 1, default: 0));
-# if __STDC_VERSION__ >= 201112L
+# if __STDC_VERSION__ >= 201112L && !defined __SUNPRO_C
   ASSERT (_Generic (countof (u8"UTF-8 string"), size_t: 1, default: 0));
   ASSERT (_Generic (countof (u"UTF-16 string"), size_t: 1, default: 0));
   ASSERT (_Generic (countof (U"UTF-32 string"), size_t: 1, default: 0));
@@ -109,8 +111,9 @@ main ()
 /* A definition of the variables a, b, c is not required by ISO C, because
    these identifiers are only used as part of 'sizeof' expressions whose
    results are integer expressions.  See ISO C 23 ยง 6.9.1.(5).  However,
-   MSVC 14 generates actual references to these variables.  We thus need
-   to define these variables; otherwise we get link errors.  */
-#if defined _MSC_VER && !defined __clang__
+   MSVC 14 and Oracle Developer Studio 12.6 generate actual references
+   to these variables.  We thus need to define these variables;
+   otherwise we get link errors.  */
+#if (defined _MSC_VER && !defined __clang__) || defined __SUNPRO_C
 int a, b, c;
 #endif