This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80409] Document that va_arg(ap, void*) can be used to consume any pointer argument
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Apr 2017 09:46:10 +0000
- Subject: [Bug c/80409] Document that va_arg(ap, void*) can be used to consume any pointer argument
- Auto-submitted: auto-generated
- References: <bug-80409-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80409
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Wed, 12 Apr 2017, pascal_cuoq at hotmail dot com wrote:
> Since the open-source world divides the C compilation platform described by the
> C standard into C compilers (Clang, GCC) and standard libraries (Glibc, musl,
> ...), with the implementation of varargs on the compiler side and the
> implementation of scanf on the standard library side, it would make sense to
> document that on target platforms where the representation of pointers is
> uniform, the compilers allow va_arg(ap, void*) to consume any pointer argument.
Note that this is documented in POSIX (XSI-shaded, in the specification of
stdarg.h).