Bug 267207
Summary: | Fix warnings found by compiling with -Wformat in open source clang-17 | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
Component: | WebKit Misc. | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=267387 https://bugs.webkit.org/show_bug.cgi?id=269508 |
David Kilzer (:ddkilzer)
Fix warnings found by compiling with -Wformat in open source clang-17.
Examples:
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:508:79: error: format specifies type 'unsigned char' but the argument has type 'ExceptionCode' [-Werror,-Wformat]
508 | RELEASE_LOG_ERROR(WebRTC, "Adding ice candidate failed %hhu", result.exception().code());
| ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
| static_cast<uint8_t>( )
Source/WebCore/platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:174:168: error: format specifies type 'int' but the argument has type 'Profile' [-Werror,-Wformat]
174 | RELEASE_LOG_ERROR(MediaStream, "VideoSampleBufferCompressor VTSessionSetProperty kVTCompressionPropertyKey_ProfileLevel failed with %d for profile %d", error, m_profile);
| ~~ ^~~~~~~~~
| static_cast<int>( )
Source/WebCore/workers/service/server/SWServer.cpp:1654:131: error: format specifies type 'unsigned char' but the argument has type 'ServiceWorkerState' [-Werror,-Wformat]
1654 | RELEASE_LOG(ServiceWorker, "SWServer::fireFunctionalEvent serviceWorkerID=%llu, state=%hhu", worker->identifier().toUInt64(), worker->state());
| ~~~~ ^~~~~~~~~~~~~~~
| static_cast<uint8_t>( )
Source/WebCore/workers/service/ServiceWorker.cpp:72:85: error: format specifies type 'unsigned char' but the argument has type 'ServiceWorkerState' [-Werror,-Wformat]
72 | WORKER_RELEASE_LOG("serviceWorkerID=%llu, state=%hhu", identifier().toUInt64(), m_data.state);
| ~~~~ ^~~~~~~~~~~~
| static_cast<uint8_t>( )
Source/WebCore/workers/service/ServiceWorker.cpp:83:139: error: format specifies type 'unsigned char' but the argument has type 'ServiceWorkerState' [-Werror,-Wformat]
83 | WORKER_RELEASE_LOG("updateState: Updating service worker %llu state from %hhu to %hhu. registrationID=%llu", identifier().toUInt64(), m_data.state, state, registrationIdentifier().toUInt64());
| ~~~~ ^~~~~~~~~~~~
| static_cast<uint8_t>( )
Source/WebCore/workers/service/ServiceWorker.cpp:83:153: error: format specifies type 'unsigned char' but the argument has type 'State' (aka 'WebCore::ServiceWorkerState') [-Werror,-Wformat]
83 | WORKER_RELEASE_LOG("updateState: Updating service worker %llu state from %hhu to %hhu. registrationID=%llu", identifier().toUInt64(), m_data.state, state, registrationIdentifier().toUInt64());
| ~~~~ ^~~~~
| static_cast<uint8_t>( )
Source/WebCore/platform/graphics/cocoa/IOSurface.mm:252:128: error: format specifies type 'int' but the argument has type 'Format' [-Werror,-Wformat]
252 | RELEASE_LOG_ERROR(Layers, "IOSurface creation failed for size: (%d %d) and format: (%d)", size.width(), size.height(), format);
| ~~ ^~~~~~
| static_cast<int>( )
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/120610377>
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/22489
EWS
Committed 272748@main (a221cbe6bf04): <https://commits.webkit.org/272748@main>
Reviewed commits have been landed. Closing PR #22489 and removing active labels.
David Kilzer (:ddkilzer)
Re-opening for pull request https://github.com/WebKit/WebKit/pull/22551
EWS
Committed 272826@main (d0259b024eaa): <https://commits.webkit.org/272826@main>
Reviewed commits have been landed. Closing PR #22551 and removing active labels.