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
Error "Unsequenced modification and access" when building distribution from sources #1487
Comments
One of the joys of being an Xcode developer is that with each release there's the chances that new clang are added to what it considers the default set. For Xcode 12, this adds -Wunsequenced. While I generally support enabling all useful warnings, it's still a hassle when they arrive unannounced. To fix any new warning that is breaking the build, take its name and prepend it with "no-". So in this case, the failing warning is "-Wunsequenced", and the workaround is to specify "-Wno-unsequenced". The j2objc build has a WARNINGS build variable, so to suppress this warning, build using:
The fix probably needs to be in the translator, as it looks to be literally translating an equivalent Java expression. The issue (as I currently understand it) is that Java guarantees that parameter expressions are executed left-to-right (JLS 15.12.4.2, but function parameters are not evaluated in a defined order in C/C++/ObjC. I think the right fix is for the translator to pull out the local variable assignment (
Do you see a simpler change? Replacing the
|
Another possibility is to extract the whole boolean expression into a private boolean method:
Hmm, that's starting to look like the same extraction done for capturing lambdas. Have to think about this some more... |
Much simpler: it's a bug (uncaught edge case) in UnsequencedExpressionRewriter. |
…Xcode 12. PiperOrigin-RevId: 335133260
The workaround to build with FYI, pull request #1488 currently only fixes the pattern found in Striped64.java. With it, the build now fails on another hot mess (err, I mean complex expression 😉) in android/util/Base64.java:
I think what happened in Xcode 12 is that clang's unsequenced warning support was significantly improved. So this is a good thing in the long run, as we need to improve the translator to match their error detection. |
…Xcode 12. PiperOrigin-RevId: 335133260
#1488 has been updated so the project now fully builds with Xcode 12. |
Thank you very much for your prompt support! |
… Xcode 12. PiperOrigin-RevId: 335133260
… Xcode 12. PiperOrigin-RevId: 335509466
… Xcode 12. PiperOrigin-RevId: 335509466
Fixed in #1488. |
…g with Xcode 12. PiperOrigin-RevId: 335509466
…g with Xcode 12. PiperOrigin-RevId: 335509466
…g with Xcode 12. PiperOrigin-RevId: 335509466
…g with Xcode 12. PiperOrigin-RevId: 335509466
Hello,
I'm trying to build the distribution from scratch from release 2.7 and Xcode 12.0.1, with the only change to default build parameters being the full list of supported architectures:
When it gets to the compilation of Striped64.m I get the following error:
I have read both issues #338 and #343, but none of the suggestions worked:
(v + x)
, but the error persisted.--extract-unsequenced
toTRANSLATE_ARGS
intranslate.mk
, then cleaning and rebuilding, but the error also persisted.Any other suggestion?
The text was updated successfully, but these errors were encountered: