-
-
Notifications
You must be signed in to change notification settings - Fork 270
Run C preprocessor in C11 mode #4933
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It should fix running clang-cpp on linux x86_64. This involves moving some linux+aarch64 fixes to linux+clang since clang was the actual issue. See-also: dlang/dmd#15320 Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
It happens with both clang and gcc. Tested with ldc2
Part of the full error:
```
Error: undefined identifier `__Float32x4_t`
Error: undefined identifier `__Float64x2_t`
Error: undefined identifier `__SVFloat32_t`
Error: undefined identifier `__SVFloat64_t`
Error: undefined identifier `__SVBool_t`
/usr/include/bits/math-vector.h(162): Error: undefined identifier `__Float32x4_t`
__attribute__ ((__aarch64_vector_pcs__)) __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
^
/usr/include/bits/math-vector.h(162): Error: undefined identifier `__Float32x4_t`
__attribute__ ((__aarch64_vector_pcs__)) __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
^
/usr/include/bits/math-vector.h(162): Error: undefined identifier `__Float32x4_t`
__attribute__ ((__aarch64_vector_pcs__)) __f32x4_t _ZGVnN4vv_atan2f (__f32x4_t, __f32x4_t);
^
/usr/include/bits/math-vector.h(163): Error: undefined identifier `__Float32x4_t`
__attribute__ ((__aarch64_vector_pcs__)) __f32x4_t _ZGVnN4v_acosf (__f32x4_t);
^
/usr/include/bits/math-vector.h(163): Error: undefined identifier `__Float32x4_t`
__attribute__ ((__aarch64_vector_pcs__)) __f32x4_t _ZGVnN4v_acosf (__f32x4_t);
^
```
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Stay consistent with the rest of the preprocessor conditionals by checking for __linux__ instead of linux. Additionally, the former also works with -std=c11 whereas the latter only works with -std=gnu11. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
With -std=c11, on linux, alloca no longer comes from stdlib.h. Also fix the URL bug number which never pointed to the right one. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
thewilsonator
approved these changes
May 17, 2025
b6ce93b to
c9bf59f
Compare
Apparently needed with `/std:c11` and Microsoft cl.exe at least:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\include\setjmp.h(170): Error: extended-decl-modifier expected after `__declspec(`, saw `_Noreturn` instead
__declspec(_Noreturn ) void longjmp(
^
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\include\intrin.h(204): Error: extended-decl-modifier expected after `__declspec(`, saw `_Noreturn` instead
__declspec(_Noreturn) void __fastfail(unsigned int);
^
|
Main reason for the eager cherry-pick: dlang/dmd#21311 - importC basically broke with gcc 15 and its changed default C standard. The upstream fixes land in v2.113 AFAICT. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basically an eager cherry-pick of