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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to