Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

va_copy unavailable when using stdarg.h with -ansi on Linux #157

Open
memreflect opened this issue Dec 11, 2024 · 0 comments · May be fixed by #163
Open

va_copy unavailable when using stdarg.h with -ansi on Linux #157

memreflect opened this issue Dec 11, 2024 · 0 comments · May be fixed by #163

Comments

@memreflect
Copy link
Contributor

memreflect commented Dec 11, 2024

(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?

@memreflect 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 jpco linked a pull request Dec 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant