[PATCH] D157793: [Headers] Add missing __need_ macros to stdarg.h

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 08:35:00 PDT 2023


aaron.ballman added a comment.

In D157793#4583698 <https://reviews.llvm.org/D157793#4583698>, @iana wrote:

> In D157793#4583663 <https://reviews.llvm.org/D157793#4583663>, @MaskRay wrote:
>
>>> Apple needs a __need_ macro for va_list. Add one, and also ones for va_start/va_arg/va_end, __va_copy, va_copy.
>>
>> Do you have a link to the specification or the source that this is needed?
>
> We need is so that our <sys/_types/_va_list.h> doesn't have to redeclare va_list and doesn't pull in all of stdarg.h either. As far as I know there's no specification for this (or stddef.h) being include-able in pieces.

I'm not opposed, but this adds significant complexity to support a questionable use case -- the C standard library headers are not intended to be partially included, so if the plan is to use these `__need` macros in all of the headers we provide, I think that should go through an RFC process to be sure we want to maintain the added complexity. (Also, who is "we" in this case?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157793



More information about the cfe-commits mailing list