Bug 258551 - Debug build with gcc fails
Summary: Debug build with gcc fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Przemyslaw Gorszkowski
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-27 00:15 PDT by Przemyslaw Gorszkowski
Modified: 2023-06-27 06:14 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Przemyslaw Gorszkowski 2023-06-27 00:15:53 PDT
This is regression after https://github.com/WebKit/WebKit/commit/fb46eb89ed570c6cab4f55ba8d7b7cd432a99e6b, logs:

In file included from /home/pgorszkowski/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/StdLibExtras.h:34,
                 from /home/pgorszkowski/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/FastMalloc.h:26,
                 from /home/pgorszkowski/WebKit/Source/WebCore/config.h:47,
                 from /home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWOriginStore.cpp:26,
                 from /home/pgorszkowski/WebKit/WebKitBuild/Debug/WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-8.cpp:1:
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp: In member function ‘void WebCore::SWServerWorker::didFinishInstall(const std::optional<WebCore::ServiceWorkerJobDataIdentifier>&, bool)’:
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:204:74: error: format ‘%hhu’ expects argument of type ‘int’, but argument 6 has type ‘WebCore::ServiceWorkerState’ [-Werror=format=]
  204 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Installing, "State is %hhu", state);
      |                                                                          ^~~~~~~~~~~~~~~  ~~~~~
      |                                                                                           |
      |                                                                                           WebCore::ServiceWorkerState
/home/pgorszkowski/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:436:99: note: in definition of macro ‘ASSERT_WITH_MESSAGE’
  436 |         WTFReportAssertionFailureWithMessage(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion, __VA_ARGS__); \
      |                                                                                                   ^~~~~~~~~~~
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:204:5: note: in expansion of macro ‘RELEASE_ASSERT_WITH_MESSAGE’
  204 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Installing, "State is %hhu", state);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pgorszkowski/WebKit/WebKitBuild/Debug/WebCore/DerivedSources/unified-sources/UnifiedSource-f74e0903-8.cpp:8:
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:204:87: note: format string is defined here
  204 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Installing, "State is %hhu", state);
      |                                                                                    ~~~^
      |                                                                                       |
      |                                                                                       int
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp: In member function ‘void WebCore::SWServerWorker::didFinishActivation()’:
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:216:74: error: format ‘%hhu’ expects argument of type ‘int’, but argument 6 has type ‘WebCore::ServiceWorkerState’ [-Werror=format=]
  216 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Activating, "State is %hhu", state);
      |                                                                          ^~~~~~~~~~~~~~~  ~~~~~
      |                                                                                           |
      |                                                                                           WebCore::ServiceWorkerState
/home/pgorszkowski/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:436:99: note: in definition of macro ‘ASSERT_WITH_MESSAGE’
  436 |         WTFReportAssertionFailureWithMessage(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion, __VA_ARGS__); \
      |                                                                                                   ^~~~~~~~~~~
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:216:5: note: in expansion of macro ‘RELEASE_ASSERT_WITH_MESSAGE’
  216 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Activating, "State is %hhu", state);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pgorszkowski/WebKit/Source/WebCore/workers/service/server/SWServerWorker.cpp:216:87: note: format string is defined here
  216 |     RELEASE_ASSERT_WITH_MESSAGE(state == ServiceWorkerState::Activating, "State is %hhu", state);
      |                                                                                    ~~~^
      |                                                                                       |
      |                                                                                       int
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.


Seems that simple static_cast<int> solves the problem.
Comment 1 Przemyslaw Gorszkowski 2023-06-27 00:32:39 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15320
Comment 2 EWS 2023-06-27 06:13:36 PDT
Committed 265546@main (fbdc29ad3c83): <https://commits.webkit.org/265546@main>

Reviewed commits have been landed. Closing PR #15320 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-06-27 06:14:18 PDT
<rdar://problem/111387789>