You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite va_copy() being required by POSIX.1-2001, it may be the compiler that defines it rather than the C library headers.
That is, glibc should be the one defining va_copy() since it's the one interfacing with the Linux kernel to implement POSIX functionality, but instead, it leaves things up to the gcc compiler, which only concerns itself with the ISO C standard and doesn't care about POSIX stuff.
The result of this disconnect is the linker used by gcc on Linux being unable to resolve va_copy() even when compiling with -D_POSIX_C_SOURCE=200112L.
I'm not sure how best to handle this, but i should note that even when va_copy() is undefined by gcc, __va_copy() is still available.
Perhaps it's worth defining va_copy() as __va_copy() when using <stdarg.h> as well, if it's not already available?
The text was updated successfully, but these errors were encountered:
memreflect
changed the title
va_copy when using stdarg.h unavailable with -ansi on Linux
va_copy unavailable when using stdarg.h with -ansi on Linux
Dec 11, 2024
jpco
linked a pull request
Dec 28, 2024
that will
close
this issue
(This is related to #3.)
Despite
va_copy()
being required by POSIX.1-2001, it may be the compiler that defines it rather than the C library headers.That is, glibc should be the one defining
va_copy()
since it's the one interfacing with the Linux kernel to implement POSIX functionality, but instead, it leaves things up to the gcc compiler, which only concerns itself with the ISO C standard and doesn't care about POSIX stuff.The result of this disconnect is the linker used by gcc on Linux being unable to resolve
va_copy()
even when compiling with-D_POSIX_C_SOURCE=200112L
.I'm not sure how best to handle this, but i should note that even when
va_copy()
is undefined by gcc,__va_copy()
is still available.Perhaps it's worth defining
va_copy()
as__va_copy()
when using<stdarg.h>
as well, if it's not already available?The text was updated successfully, but these errors were encountered: