-
Notifications
You must be signed in to change notification settings - Fork 56
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
Incorrect const qualifier? #15
Comments
I can't reproduce this. What clang version do you use? |
On 07/18/18 00:30, David Callahan wrote:
Using current trunk (master).
Here is a test case
|#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1 #include
<boost/atomic.hpp> typedef boost::atomics::detail::gcc_dcas_x86_64<true>
DCAS; const volatile DCAS::storage_type data = 0; unsigned get() {
return DCAS::load(data, boost::memory_order::relaxed); } |
The current develop doesn't fail the compilation with clang 6.0, but the
test case is not valid. boost::atomic objects (and their internal
storage) must reside in writable memory. load() may issue store
operation on the storage memory even though the stored value doesn't change.
|
With boost 1.67 and clang-7, I can reproduce the issue with this: echo '#include <boost/log/utility/setup.hpp>' > /tmp/a.cpp && clang++ -c -march=haswell /tmp/a.cpp
|
6e14ca2 indeed fixes the issue -- boost 1.69 works! Thanks! |
On 12/18/18 3:18 PM, fiesh wrote:
@Lastique Any chance this can be re-opened?
No, the problem has been fixed already.
|
Yeah that's why I had removed the comment before your answer and replaced it with the other one. |
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
* we've moved to cmake 3.5, so no need to hack for newer cmake * nss dependency is dropped, no need to install it anymore * pass clang and clang++ using cmake variable to be more consistent * pass CMAKE_EXE_LINKER_FLAGS as `/usr/local/opt/llvm/lib` is not in default library paths. * mention boostorg/atomic#15 Signed-off-by: Kefu Chai <kchai@redhat.com>
So basically, this is fixed in 1.69 which is incompatible with MacOS and that means you won't fix 1.67.... |
I had the same issue but upgrading to boost 1.72 solved it. I'm on Mac Catalina |
Due to this: boostorg/atomic#15
Due to this: boostorg/atomic#15
* boost 1.69 Due to this: boostorg/atomic#15 * build boost with libs for asio * Boost 1.74 Download from dl.bintray.com/boostorg/ because Boost 1.74 .bz2 is larger than GitHub will allow without LFS * set BUILD_BYPRODUCTS (just setting one library, and doesn't handle windows.. I don't know what is correct anyway) * build with b2 * Try Boost.cmake from Kevin * Specify toolset in configure command line * Use POL_EXT_LIB_DIR. Make clib depend on boost, not pol itself * cache boost for github actions * Copy-pasta correction * Cache boost for additional github build workflows * cache boost for coverage build, updated cache action version Co-authored-by: Kevin Eady <8634912+KevinEady@users.noreply.github.com> Co-authored-by: turleypol <turley@polserver.com>
Using a near-trunk build of clang which as a new semantic check, I get this error:
which is generated due to the "const" declaration in this static function:
https://github.com/boostorg/atomic/blob/develop/include/boost/atomic/detail/ops_gcc_x86_dcas.hpp#L402
The error seems correct but so does the code. I worked around this by casting away the const operand to the intrinsic.
The text was updated successfully, but these errors were encountered: