Skip to content
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

clang-cl - Conflicting types for atomic_signal_fence #123457

Closed
Neumann-A opened this issue Jan 18, 2025 · 3 comments
Closed

clang-cl - Conflicting types for atomic_signal_fence #123457

Neumann-A opened this issue Jan 18, 2025 · 3 comments
Labels
clang:headers Headers provided by Clang, e.g. for intrinsics duplicate Resolved as duplicate platform:windows

Comments

@Neumann-A
Copy link

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.

@EugeneZelenko EugeneZelenko added clang-cl `clang-cl` driver. Don't use for other compiler parts and removed new issue labels Jan 18, 2025
@frederick-vs-ja
Copy link
Contributor

MSVC STL's atomic_signal_fence has noexcept while Clang's has not...

@frederick-vs-ja frederick-vs-ja added the clang:headers Headers provided by Clang, e.g. for intrinsics label Jan 20, 2025
@Neumann-A
Copy link
Author

MSVC STL's atomic_signal_fence has noexcept while Clang's has not...

I did try to add noexcept. Still the same error.

@AaronBallman
Copy link
Collaborator

I cannot reproduce the issue with Clang trunk; can you try with the latest Clang and see if the issue still reproduces for you?

@AaronBallman AaronBallman added the duplicate Resolved as duplicate label Apr 2, 2025
@EugeneZelenko EugeneZelenko added platform:windows and removed clang-cl `clang-cl` driver. Don't use for other compiler parts labels Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:headers Headers provided by Clang, e.g. for intrinsics duplicate Resolved as duplicate platform:windows
Projects
None yet
Development

No branches or pull requests

5 participants