Closed Bug 1610974 Opened 4 years ago Closed 4 years ago

error about designated initializer in LookAndFeelInt

Categories

(Core :: Widget, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
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!

Flags: needinfo?(hikezoe.birchill)

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: nobody → hikezoe.birchill
Flags: needinfo?(hikezoe.birchill)

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
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

The patch actually introduced more instances of mixture of designated and non-designated initializers...

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

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]

Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/94cf2aa1620b
Use designated initializers consistently in LookAndFeelInt r=hiro
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Blocks: clang-10
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: