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

atomic: fix compilation for C++ and Windows-ARM64 #1259

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

alfredh
Copy link
Contributor

@alfredh alfredh commented Jan 9, 2025

original error for C++ file on Windows-ARM64:

C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm64\cl.exe  /nologo /TP -DARCH=\"AMD64\" -DHAVE_ATOMIC -DHAVE_IO_H -DHAVE_PQOS_FLOWID -DHAVE_QOS_FLOWID -DHAVE_SELECT -DHAVE_UNIXSOCK=1 -DOS=\"Windows\" -DRE_VERSION=\"3.18.0\" -DVER_MAJOR=3 -DVER_MINOR=18 -DVER_PATCH=0 -DWIN32 -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_WIN32_WINNT=0x0600 -Dretest_EXPORTS -ID:\a\re\re\test\. -ID:\a\re\re\include /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -MDd -Zi /W3 /showIncludes /Fotest\CMakeFiles\retest.dir\cplusplus.cpp.obj /Fdtest\CMakeFiles\retest.dir\ /FS -c D:\a\re\re\test\cplusplus.cpp D:\a\re\re\include\re_atomic.h(602): error C2664: 'char __iso_volatile_load8(volatile const char *)': cannot convert argument 1 from 'const unsigned char *' to 'volatile const char *' D:\a\re\re\include\re_atomic.h(602): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast

I am not an expert on atomics, perhaps there are better solutions.

original error for C++ file on Windows-ARM64:

C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm64\cl.exe  /nologo /TP -DARCH=\"AMD64\" -DHAVE_ATOMIC -DHAVE_IO_H -DHAVE_PQOS_FLOWID -DHAVE_QOS_FLOWID -DHAVE_SELECT -DHAVE_UNIXSOCK=1 -DOS=\"Windows\" -DRE_VERSION=\"3.18.0\" -DVER_MAJOR=3 -DVER_MINOR=18 -DVER_PATCH=0 -DWIN32 -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_WIN32_WINNT=0x0600 -Dretest_EXPORTS -ID:\a\re\re\test\. -ID:\a\re\re\include /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -MDd -Zi /W3 /showIncludes /Fotest\CMakeFiles\retest.dir\cplusplus.cpp.obj /Fdtest\CMakeFiles\retest.dir\ /FS -c D:\a\re\re\test\cplusplus.cpp
D:\a\re\re\include\re_atomic.h(602): error C2664: 'char __iso_volatile_load8(volatile const char *)': cannot convert argument 1 from 'const unsigned char *' to 'volatile const char *'
D:\a\re\re\include\re_atomic.h(602): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast

I am not an expert on atomics, perhaps there are better
solutions.
@sreimers sreimers merged commit 169f642 into main Jan 9, 2025
35 of 38 checks passed
@sreimers sreimers deleted the atomic_windows_arm64 branch January 9, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants