Bug 267203 - Fix warnings found by compiling with -Wc99-designator and -Wreorder-init-list
Summary: Fix warnings found by compiling with -Wc99-designator and -Wreorder-init-list
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks: 267387
  Show dependency treegraph
 
Reported: 2024-01-07 08:15 PST by David Kilzer (:ddkilzer)
Modified: 2024-01-10 17:53 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2024-01-07 08:15:05 PST
Fix warnings found by compiling with -Wc99-designator and -Wreorder-init-list.


Examples:


Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:181:9: error: mixture of designated and non-designated initializers in the same initializer list is a C99 extension [-Werror,-Wc99-designator]
  181 |         .width = width(),
      |         ^~~~~~~~~~~~~~~~
Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:180:9: note: first non-designated initializer is here
  180 |         { .codec = codec() },
      |         ^~~~~~~~~~~~~~~~~~~~
Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:184:9: error: ISO C++ requires field designators to be specified in declaration order; field 'framerate' will be initialized after field 'colorSpace' [-Werror,-Wreorder-init-list]
  184 |         .colorSpace = colorSpace(),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
Source/WebCore/platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:183:22: note: previous initialization for field 'framerate' is here
  183 |         .framerate = framerate(),
      |                      ^~~~~~~~~~~
2 errors generated.
Comment 1 Radar WebKit Bug Importer 2024-01-07 08:15:57 PST
<rdar://problem/120609492>
Comment 2 David Kilzer (:ddkilzer) 2024-01-07 08:19:51 PST
Pull request: https://github.com/WebKit/WebKit/pull/22481
Comment 3 David Kilzer (:ddkilzer) 2024-01-07 08:25:03 PST
Pull request: https://github.com/WebKit/WebKit/pull/22485
Comment 4 EWS 2024-01-08 07:58:06 PST
Committed 272764@main (b5982fde2d0a): <https://commits.webkit.org/272764@main>

Reviewed commits have been landed. Closing PR #22485 and removing active labels.