[Bug c/80409] Document that va_arg(ap, void*) can be used to consume any pointer argument

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 21 09:46:00 GMT 2017


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).


More information about the Gcc-bugs mailing list