Fix C++20 -Wdeprecated-volatile warnings in dom/media
Categories
(Core :: Audio/Video, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(2 files)
C++20 deprecated decrement/increment of object of volatile-qualified types, e.g. v++.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html
dom/media/systemservices/CamerasParent.cpp:1073:20: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
If counter
variable was incremented on the main thread, we could just remove the volatile
. But it's incremented off the main thread, so we need to protect against races from multiple CamerasParent
objects.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
C++20 deprecated decrement/increment of object of volatile-qualified types, e.g. v++.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html
dom/media/systemservices/CamerasParent.cpp:1073:20: '++' expression of 'volatile'-qualified type is deprecated [-Wvolatile]
If counter variable was incremented on the main thread, we could just remove the volatile. But it's incremented off the main thread, so we need to protect against races from multiple CamerasParent objects.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
C++20 deprecated decrement/increment of object of volatile-qualified types, e.g. v++.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html
warning: compound assignment with 'volatile'-qualified left operand is deprecated [-Wvolatile]
In this case, mInt doesn't need to be atomic. The test only cares that the Foo::Notify5() member function is volatile.
Depends on D163164
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed8fb724900a Fix C++20 -Wdeprecated-volatile warning by replacing volatile variable with an atomic. r=media-playback-reviewers,padenot https://hg.mozilla.org/integration/autoland/rev/26b9e9e304fc Fix C++20 -Wdeprecated-volatile warning by replacing postfix increment with addition. r=media-playback-reviewers,padenot
Comment 4•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ed8fb724900a
https://hg.mozilla.org/mozilla-central/rev/26b9e9e304fc
Description
•