<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123457>123457</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-cl - Conflicting types for atomic_signal_fence
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Neumann-A
</td>
</tr>
</table>
<pre>
LLVM: 19.1.6
MSVC: 17.12.3
```
D:\installed\x64-windows\compiler-llvm\bin\clang-cl.exe -TP -DNOMINMAX -DQJp2Plugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_GUI_LIB -DQT_NO_AS_CONST=1 -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_FOREACH=1 -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QSNPRINTF -DQT_PLUGIN -DQT_USE_QSTRINGBUILDER -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:\b\qtimageformats\x64-windows-static-rel\src\plugins\imageformats\jp2\QJp2Plugin_autogen\include -ID:\b\qtimageformats\src\here-src-6-3afc88f6f5.clean\src\plugins\imageformats\jp2 -ID:\b\qtimageformats\x64-windows-static-rel\src\plugins\imageformats\jp2 -ID:\b\qtimageformats\x64-windows-static-rel\include -imsvcD:\installed\x64-windows\VS\VC\Tools\MSVC\14.42.34433\include -imsvcD:\installed\x64-windows\VS\VC\Tools\MSVC\14.42.34433\ATLMFC\include -imsvcD:\installed\x64-windows\VS\VC\Auxiliary\VS\include -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\10\include\10.0.26100.0\ucrt" -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\10\include\10.0.26100.0\um" -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\10\include\10.0.26100.0\shared" -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\10\include\10.0.26100.0\winrt" -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\10\include\10.0.26100.0\cppwinrt" -imsvc"D:\installed\x64-windows\WinSDK\Windows Kits\NETFXSDK\4.8.1\include\um" -imsvcD:\installed\x64-windows-static\include -imsvcD:\installed\x64-windows-static\include\Qt6\QtCore -imsvcD:\installed\x64-windows-static\include\Qt6 -imsvcD:\installed\x64-windows-static\share\Qt6\mkspecs\win32-clang-msvc -imsvcD:\installed\x64-windows-static\include\Qt6\QtGui /nologo /DWIN32 /D_WINDOWS -Wno-implicit-function-declaration /utf-8 -msse4.2 -m64 /GR /EHsc /MD /O2 /Oi /Gy /DNDEBUG /Z7 -std:c++17 -MD /W3 /EHs-c- /wd4530 /wd4577 -Wno-ignored-attributes -ftrivial-auto-var-init=pattern /showIncludes /Fosrc\plugins\imageformats\jp2\CMakeFiles\QJp2Plugin.dir\qjp2handler.cpp.obj /Fdsrc\plugins\imageformats\jp2\CMakeFiles\QJp2Plugin.dir\ -c -- D:\b\qtimageformats\src\here-src-6-3afc88f6f5.clean\src\plugins\imageformats\jp2\qjp2handler.cpp
In file included from D:\b\qtimageformats\src\here-src-6-3afc88f6f5.clean\src\plugins\imageformats\jp2\qjp2handler.cpp:12:
In file included from D:\installed\x64-windows-static\include\jasper/jasper.h:78:
In file included from D:\installed\x64-windows-static\include\jasper/jas_init.h:73:
In file included from D:\installed\x64-windows-static\include\jasper/jas_malloc.h:81:
In file included from D:\installed\x64-windows-static\include\jasper/jas_thread.h:89:
D:\installed\x64-windows\compiler-llvm\lib\clang\19\include\stdatomic.h(82,6): error: conflicting types for 'atomic_thread_fence'
82 | void atomic_thread_fence(memory_order);
| ^
D:\installed\x64-windows\VS\VC\Tools\MSVC\14.42.34433\include\atomic(308,36): note: previous definition is here
308 | _EXPORT_STD extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept {
| ^
In file included from D:\b\qtimageformats\src\here-src-6-3afc88f6f5.clean\src\plugins\imageformats\jp2\qjp2handler.cpp:12:
In file included from D:\installed\x64-windows-static\include\jasper/jasper.h:78:
In file included from D:\installed\x64-windows-static\include\jasper/jas_init.h:73:
In file included from D:\installed\x64-windows-static\include\jasper/jas_malloc.h:81:
In file included from D:\installed\x64-windows-static\include\jasper/jas_thread.h:89:
D:\installed\x64-windows\compiler-llvm\lib\clang\19\include\stdatomic.h(83,6): error: conflicting types for 'atomic_signal_fence'
83 | void atomic_signal_fence(memory_order);
| ^
D:\installed\x64-windows\VS\VC\Tools\MSVC\14.42.34433\include\atomic(312,36): note: previous definition is here
312 | _EXPORT_STD extern "C" inline void atomic_signal_fence(const memory_order _Order) noexcept {
| ^
2 errors generated.
```
Adding a `#ifndef _MSC_VER` around the two `atomic_` functions makes the code compile but I don't know if that is the correct fix.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWF9zm7oS_zTyi0YMCLDJgx8IYJdzHJwC-XPvCyODsJUC4koif779HYGTNGnntGlPes5DZxghLavfb1da7QJESrbvKF0C9xS44YwM6sDFMqFDS7oO-bMdrx6Wm83lGbB9aJ0YljEHpn-WXQajYGFY2LCB6etrbh4v0w-B7QM3YJ1UpGloBdzgfu6gO9ZV_E4CNyh527OGCtQ0ty1wgx3rtLQh3R6VjUHvKUT5OURhsj2LkzP_GqLw4x89Pm-GPeuK6Pp8m-aZFuZFsE2jYhOfTqMwOk-jwM-jsLjy0yRO1ke16Pp8EwdxXnxcxZuoCLZJlqcXQR5vk2KVbs-Kcz__MKmuL-JnwGRb-NmkDuzQehKG0enF-mkUXQfRucbKnkSrbRr5wYfX4xcgf_iXfpHl_9lERZxHqZ9v02eAxE_T7VWcrDX7ZZRmGr6IEz1MoiB_UvzoZ6N9z4LoOvjgJ-voWZ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