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
celt/speex fails to build with _FORTIFY_SOURCE=2 #13544
Comments
This comes down to: // a.c
#include <io.h> $ gcc -c a.c -D_FORTIFY_SOURCE=2 -O2
In file included from a.c:4:
C:/msys64/ucrt64/include/io.h: In function '_open':
C:/msys64/ucrt64/include/io.h:407:7: error: invalid use of '__builtin_va_arg_pack_len ()'
407 | if (__builtin_va_arg_pack_len() > 1)
... |
Now this is weird. I tried this in an UCRT64 environment (fully upgraded) and I don't get any error with this input file and this exact command. Is there perhaps some file that does get included optionally if it exists (and/or gets included before some other file, if some package is installed), changing how things behave in your case? Can you get me the output of |
uh, you're right, I mixed things up somehow, sorry: #define __attribute__(x)
#include <io.h> which comes from https://gitlab.xiph.org/xiph/celt/-/blob/e18de7747fb1655e66bf8d291560587036bfe53c/tools/wave_out.h#L73 so that's kinda expected to fail I guess. Those files are only included under Windows, so the code was likely trying to port to MSVC via macro hackery without taking mingw into account. I'll try to fix this upstream. |
Oh - no wonder that will break, yeah. I think I've run into such code elsewhere at some other point too. By doing that, essentially all bets are off how things work - it's a wonder nothing else has broken so far.
Yup, that sounds plausible. Thanks for fixing! |
I've created two MRs upstream: |
to clarify: celt builds fine for all envs without any modification. Forcing _FORTIFY_SOURCE results in this error:
Using:
The text was updated successfully, but these errors were encountered: