]> sourceware.org Git - glibc.git/commitdiff
wchar: Define va_list for POSIX (BZ #30035)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 23 Jan 2023 16:59:31 +0000 (13:59 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 25 May 2023 19:43:29 +0000 (16:43 -0300)
This was uncovered by a recent clang change [1].  Different than ISO C,
POSIX states that va_list should be exported by wchar.h [2].

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

[1] https://reviews.llvm.org/D137268
[2] https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/wchar.h.html

conform/data/wchar.h-data
wcsmbs/wchar.h

index e414651a330bc273cb6df06bc8b7c3afecf235ca..243321090deae6ad76b9534a82d1790ee350e91a 100644 (file)
@@ -15,6 +15,11 @@ type size_t
 type locale_t
 # endif
 tag {struct tm}
+# if !defined ISO99 && !defined ISO11 && !defined UNIX98
+type va_list
+# else
+#  define va_list __gnuc_va_list
+# endif
 
 function wint_t btowc (int)
 function int fwprintf (FILE*, const wchar_t*, ...)
@@ -59,17 +64,17 @@ function wint_t towlower (wint_t)
 function wint_t towupper (wint_t)
 # endif
 function wint_t ungetwc (wint_t, FILE*)
-function int vfwprintf (FILE*, const wchar_t*, __gnuc_va_list)
+function int vfwprintf (FILE*, const wchar_t*, va_list)
 # ifndef UNIX98
-function int vfwscanf (FILE*, const wchar_t*, __gnuc_va_list)
+function int vfwscanf (FILE*, const wchar_t*, va_list)
 # endif
-function int vwprintf (const wchar_t*, __gnuc_va_list)
+function int vwprintf (const wchar_t*, va_list)
 # ifndef UNIX98
-function int vwscanf (const wchar_t*, __gnuc_va_list)
+function int vwscanf (const wchar_t*, va_list)
 # endif
-function int vswprintf (wchar_t*, size_t, const wchar_t*, __gnuc_va_list)
+function int vswprintf (wchar_t*, size_t, const wchar_t*, va_list)
 # ifndef UNIX98
-function int vswscanf (const wchar_t*, const wchar_t*, __gnuc_va_list)
+function int vswscanf (const wchar_t*, const wchar_t*, va_list)
 # endif
 # if defined XOPEN2K8 || defined POSIX2008
 function {wchar_t*} wcpcpy (wchar_t*, const wchar_t*)
index acc2eb9ddf38a9a6db2c5330a3c274f349f95e6f..d16f2e6951aec11622fbd47cc72b7e91cebb1f8b 100644 (file)
 #define __need___va_list
 #include <stdarg.h>
 
+#if defined __USE_XOPEN2K || defined __USE_XOPEN2K8
+# ifdef __GNUC__
+#  ifndef _VA_LIST_DEFINED
+typedef __gnuc_va_list va_list;
+#   define _VA_LIST_DEFINED
+#  endif
+# else
+#  include <stdarg.h>
+# endif
+#endif
+
 #include <bits/wchar.h>
 #include <bits/types/wint_t.h>
 #include <bits/types/mbstate_t.h>
This page took 0.049812 seconds and 5 git commands to generate.