-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Regressed compile support for clang-3.5 #2459
Comments
Is there a downside to not initializing the vector with the correct size? It should grow automatically and we only expect a maximum of 255 only, so performance-wise there shouldn't be problems. |
@freenerd your assessment is correct. This is not in a hot loop, so the default growing behaviour will work fine. |
I worked with @daniel-j-h to come up with #2462 - will merge that and close this once I confirm all tests still pass. |
For the record, it's not about growing behavior. We initialize We had two problems with the code:
@freenerd welcome to the world of pain and suffering :) |
@daniel-j-h now hitting this with clang-3.8 on circleci: https://circleci.com/gh/Project-OSRM/osrm-backend/47. @daniel-j-h can you think of a way to re-write this code to avoid this type of usage of atomic? |
@daniel-j-h asking about re-writing because overall:
|
|
Nevermind, spoke too soon. Even after upgrading libstdc++6 clang-3.8 still errors with:
|
This small self-contained example works on gcc 4.9, gcc 6.3, llvm 3.8, llvm 3.6: #include <vector>
#include <atomic>
int main() {
std::vector<std::atomic<int>> vais(10);
for (auto& each : vais)
each.store(0);
} It's not using If clang 3.5 breaks on this but works with one of the other workarounds above, you have two options: 1/ ifdef the clang 3.5 workaround 2/ use a |
solved by cd30f37 |
Interestingly as part of #2496 I tried enabling clang-3.5 builds against, but via mason provided 3.5.2 binary. The compile now worked, but I hit the below errors in tests. I am going to ignore these as clang-3.8 works (and the sanitizers work with 3.8) so I'm not longer personally interested in 3.5 support. But here are the errors for the record:
|
This looks to me like you forgot to run |
Closing as not actionable for us. Feel free to re-open if this still happens. |
The changes in #2440 triggered a new compile error when building with clang-3.5 on linux. This compiler is an important one to maintain support for because it is the only clang version (at least at the moment) that is easily installable on travis and has working sanitizers. In the process of trying to enable a travis job with the sanitizers this broke:
It looks like the problem is in the constructor, since this works around the problem:
/cc @daniel-j-h @freenerd
The text was updated successfully, but these errors were encountered: