msp430: Discard order argument when using __sync_xxx for atomics#6587
Merged
OlegHahm merged 2 commits intoRIOT-OS:masterfrom Mar 8, 2017
Merged
msp430: Discard order argument when using __sync_xxx for atomics#6587OlegHahm merged 2 commits intoRIOT-OS:masterfrom
OlegHahm merged 2 commits intoRIOT-OS:masterfrom
Conversation
55 tasks
b3ecebc to
c5118c5
Compare
Member
Author
|
required for #5616 to build on msp430 |
Member
Author
|
ping @kaspar030 |
c5118c5 to
16d9f0e
Compare
OlegHahm
requested changes
Mar 6, 2017
Member
OlegHahm
left a comment
There was a problem hiding this comment.
Just a nit: the commit message of the second commit seems too long.
16d9f0e to
b95eca2
Compare
Member
Author
|
@OlegHahm addressed commit message, ready for review |
added 2 commits
March 7, 2017 10:21
This line gave a -Wunused-value in gcc-4.6 before the stdatomic.h header for msp430 was modified as a workaround.
b95eca2 to
0f74b5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the false positive -Wunused-value warning when building with gcc-4.6.3 on msp430.
Previously we had to explicitly ignore the value to avoid getting
The compiler mistakenly thinks that the
atomic_fetch_addcall is without side effects when used in the original implementation with the comma operator. I think it is likely a compiler bug, but the compiler is age old and I don't have any more time to spend on this.With this PR, the order argument is silently discarded by the preprocessor, instead of evaluated and the result discarded. The order argument is ignored in our implementations of the helper library anyway, and it would just bad coding practice if you pass functions with side effects as the order argument on the atomic operation, so it should not really make any difference.