[clang] [clang][ARM][AArch64] Define intrinsics guarded by __has_builtin on all platforms (PR #128222)
Martin Storsjö via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 22 01:01:19 PDT 2025
mstorsjo wrote:
This breaks real-world code with MSVC headers.
Testcase:
```c
#include <windows.h>
#include <winnt.h>
void func(void) { _InstructionSynchronizationBarrier(); }
```
```
$ bin/clang-cl --target=aarch64-windows-msvc -c isb.c
isb.c(3,19): error: call to undeclared library function '__isb' with type 'void (unsigned int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3 | void func(void) { _InstructionSynchronizationBarrier(); }
| ^
/home/martin/msvc2022-17.13/kits/10/include/10.0.22621.0/um/winnt.h(5717,46): note: expanded from macro '_InstructionSynchronizationBarrier'
5717 | #define _InstructionSynchronizationBarrier() __isb(_ARM64_BARRIER_SY)
| ^
isb.c(3,19): note: include the header <arm_acle.h> or explicitly provide a declaration for '__isb'
/home/martin/msvc2022-17.13/kits/10/include/10.0.22621.0/um/winnt.h(5717,46): note: expanded from macro '_InstructionSynchronizationBarrier'
5717 | #define _InstructionSynchronizationBarrier() __isb(_ARM64_BARRIER_SY)
| ^
1 error generated.
```
https://github.com/llvm/llvm-project/pull/128222
More information about the cfe-commits
mailing list