RESOLVED FIXED 267207
Fix warnings found by compiling with -Wformat in open source clang-17
https://bugs.webkit.org/show_bug.cgi?id=267207
Summary Fix warnings found by compiling with -Wformat in open source clang-17
David Kilzer (:ddkilzer)
Reported 2024-01-07 09:00:12 PST
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
Radar WebKit Bug Importer
Comment 1 2024-01-07 09:00:49 PST
David Kilzer (:ddkilzer)
Comment 2 2024-01-07 09:04:04 PST
EWS
Comment 3 2024-01-07 12:51:36 PST
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)
Comment 4 2024-01-09 12:42:16 PST
EWS
Comment 5 2024-01-09 13:35:25 PST
Committed 272826@main (d0259b024eaa): <https://commits.webkit.org/272826@main> Reviewed commits have been landed. Closing PR #22551 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.