From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 1663F3858D37; Thu, 25 May 2023 19:58:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1663F3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685044680; bh=2pycu81gt8TAyM02Tj54NP4hwZUsyeIaxhjk31/mMK0=; h=From:To:Subject:Date:From; b=OUHAzSVN5MCZbN9gwjuTct4MIxDJbQlV6CNkmlDOiCZ1sbRs18B6TUHnMnzVBqTGh /1g5DjJGMvP/u2bg5nzAhLrCyUTrSVTLGWBhrWi3lTg39V6Dle3WMX3c0x7cjaPKn1 NegM5r14r9ppi1t/tVpUDIhCn3kK9FffR02T7jVk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] wchar: Define va_list for POSIX (BZ #30035) X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: d2b1af43057c2bde5b180868a67d2b2bc2de95b7 X-Git-Newrev: a363f7075125fa654342c69331e6c075518ec28c Message-Id: <20230525195800.1663F3858D37@sourceware.org> Date: Thu, 25 May 2023 19:58:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a363f7075125fa654342c69331e6c075518ec28c commit a363f7075125fa654342c69331e6c075518ec28c Author: Adhemerval Zanella Date: Mon Jan 23 13:59:31 2023 -0300 wchar: Define va_list for POSIX (BZ #30035) 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 Diff: --- conform/data/wchar.h-data | 17 +++++++++++------ wcsmbs/wchar.h | 11 +++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/conform/data/wchar.h-data b/conform/data/wchar.h-data index e414651a33..243321090d 100644 --- a/conform/data/wchar.h-data +++ b/conform/data/wchar.h-data @@ -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*) diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index acc2eb9ddf..d16f2e6951 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -37,6 +37,17 @@ #define __need___va_list #include +#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 +# endif +#endif + #include #include #include