[clang] [C2y] Add documentation to conform to WG14 N3262; NFC (PR #98146)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 10:29:21 PDT 2024


rjmccall wrote:

I also have trouble imagining why a target would ever want to make `va_copy` a non-trivial operation, and I suspect that in practice programmers do not reliably call `va_end` to clean up their iterations.  In general, I would say that platforms should be moving towards making varargs *simpler* by just treating variadic arguments differently from required arguments in the ABI, the way AArch64 originally did and still does on Apple platforms.

I wouldn't want to lock us out of supporting a target that required a non-trivial `va_copy` for whatever awful reason, but we could be clear that it's only UB on such targets.  I don't think we actually gain anything from making it UB; I can't imagine what optimizations that would enable.

https://github.com/llvm/llvm-project/pull/98146


More information about the cfe-commits mailing list