wchar: Define va_list for POSIX (BZ #30035)
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
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 | 3 +++
wcsmbs/wchar.h | 11 +++++++++++
2 files changed, 14 insertions(+)
Comments
On Jan 23 2023, Adhemerval Zanella via Libc-alpha wrote:
> diff --git a/conform/data/wchar.h-data b/conform/data/wchar.h-data
> index e414651a33..582a99c00b 100644
> --- a/conform/data/wchar.h-data
> +++ b/conform/data/wchar.h-data
> @@ -15,6 +15,9 @@ type size_t
> type locale_t
> # endif
> tag {struct tm}
> +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined UNIX98
This is enclosed in !defined ISO && !defined POSIX && !defined XPG4 &&
!defined XPG42, so parts of the expression are redundant.
@@ -15,6 +15,9 @@ type size_t
type locale_t
# endif
tag {struct tm}
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined UNIX98
+type va_list
+#endif
function wint_t btowc (int)
function int fwprintf (FILE*, const wchar_t*, ...)
@@ -37,6 +37,17 @@
#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>