error about designated initializer in LookAndFeelInt
Categories
(Core :: Widget, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: away, Assigned: hiro)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Using the upcoming clang version 10, and --enable-warning-as-errors
like automation, the build fails with the following error:
0:13.64 widget/nsXPLookAndFeel.cpp(1103,22): error: mixture of designated and non-designated initializers in the same initializer list is a C99 extension [-Werror,-Wc99-designator]
0:13.64 LookAndFeelInt{.id = eIntID_PrefersReducedMotion, {.value = value}});
0:13.64 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0:13.64 widget/nsXPLookAndFeel.cpp(1103,57): note: first non-designated initializer is here
0:13.64 LookAndFeelInt{.id = eIntID_PrefersReducedMotion, {.value = value}});
0:13.64 ^~~~~~~~~~~~~~~~
It looks like clang is not so happy about the second member being an anonymous union, so we can't name it directly.
:hiro, would it be possible to write this initialization in a different way? Thanks!
Assignee | ||
Comment 1•4 years ago
•
|
||
I actually wrote a different way but it was complained by a GCC warning such as "uninitialized blah blah blah". That's said, colorValue
in the union in question should have been dropped in bug 1606503. We just need to drop nscolor colorValue
and drop the union.
Assignee | ||
Comment 2•4 years ago
|
||
It should have been dropped in bug 1606503, I did foget it.
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0d25ba0ac108 Drop colorValue in LookAndFeelInt. r=geckoview-reviewers,snorp
Comment 4•4 years ago
|
||
bugherder |
The patch actually introduced more instances of mixture of designated and non-designated initializers
...
To avoid a clang-10 failure with error: mixture of designated and non-designated initializers in the same initializer list is a C99 extension [-Werror,-Wc99-designator]
Updated•4 years ago
|
Pushed by dmajor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/94cf2aa1620b Use designated initializers consistently in LookAndFeelInt r=hiro
Comment 8•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•