[SERVER-53828] Fix unsequenced modifications in oplog_applier_impl_test.cpp Created: 15/Jan/21 Updated: 29/Oct/23 Resolved: 22/Jan/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Service Arch 2021-02-08 |
| Participants: |
| Description |
|
Building on XCode clang: oplog_applier_impl_test.cpp:1620:78: error: unsequenced modification and access to 'seconds' [-Werror,-Wunsequenced] Occurs in 4 places. |
| Comments |
| Comment by Githook User [ 22/Jan/21 ] | |||||
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: | |||||
| Comment by Billy Donahue [ 15/Jan/21 ] | |||||
| Comment by Billy Donahue [ 15/Jan/21 ] | |||||
|
I think changing the Duration constructor to take the count by value instead of by reference exposed this bug. https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/oplog_applier_impl_test.cpp#L1620 There are a few places in the test that do this pattern:
And it's indeterminate whether Seconds(seconds) is executed before or after the seconds++. PS: I'm also throwing in another XCode warning-made-error having to do with an unnecessary loop variable copy. |