[PATCH] D137268: [clang][Headers] Do not define varargs macros for __need___va_list

Adhemerval Zanella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 11:43:13 PST 2023


zatrazz added a comment.

In D137268#4069779 <https://reviews.llvm.org/D137268#4069779>, @enh wrote:

> is there a corresponding glibc change so that `va_list` is exported for `_POSIX_SOURCE` cases? see https://android-review.git.corp.google.com/c/platform/bionic/+/2397313 where i'm having to disable some bionic testing against glibc because the glibc (2.17!) <wchar.h> now no longer exports `va_list`. i did look for a ToT glibc patch to backport (until we've _actually_ switched from glibc to musl for the host), but couldn't obviously find it?
>
> https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/wchar.h.html says:
> """
> The <wchar.h> header shall define the following types:
> ...
> va_list
> [CX] As described in <stdarg.h>.
> """
> which is why i think our "<wchar.h> exports `va_list`" test is correct. (Android doesn't support an "ISO only" mode --- you're effectively always in `_POSIX_SOURCE` mode, so we build the test against glibc with `_POSIX_SOURCE` defined.)

I think I have caught this because your standard conformance tests checks for __gnuc_va_list 
on wchar.h, wich is always defined on on GCC (git log shows it was changed to fix XPG7 
tests, but I am not sure exactly why the author has changed the va_list to __gnuc_va_list).

And it seems that glibc seems broken also using GCC stdarg.h if I fix the test to check for
va_list instead. I will take a look at this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137268/new/

https://reviews.llvm.org/D137268



More information about the cfe-commits mailing list