RESOLVED FIXED306542
Compilation error with -Wunsafe-buffer-usage-in-format-attr-call when using latest Swift toolchain
https://bugs.webkit.org/show_bug.cgi?id=306542
Summary Compilation error with -Wunsafe-buffer-usage-in-format-attr-call when using l...
Ryosuke Niwa
Reported 2026-01-29 09:33:23 PST
Using main Swift toolchain, we hit the following error: ``` /Volumes/Data/webkit/Source/WTF/wtf/cocoa/SystemTracingCocoa.cpp:56:36: error: formatting function '__builtin_os_log_format_buffer_size' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call] 56 | FOR_EACH_WTF_SIGNPOST_NAME(WTF_SIGNPOST_EVENT_BEGIN_INTERVAL_CASE_LABEL) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Volumes/Data/webkit/Source/WTF/wtf/cocoa/SystemTracingCocoa.cpp:27: /Volumes/Data/webkit/Source/WTF/wtf/SystemTracing.h:275:5: note: expanded from macro 'FOR_EACH_WTF_SIGNPOST_NAME' 275 | M(AccessibilityIsolatedTreeApplyPendingChanges) \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Volumes/Data/webkit/Source/WTF/wtf/cocoa/SystemTracingCocoa.cpp:53:45: note: expanded from macro 'WTF_SIGNPOST_EVENT_BEGIN_INTERVAL_CASE_LABEL' 53 | WTF_SIGNPOST_EVENT_EMIT_FUNC_CASE_LABEL(os_signpost_interval_begin, name, " %{signpost.description:begin_time}llu") | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Volumes/Data/webkit/Source/WTF/wtf/cocoa/SystemTracingCocoa.cpp:47:9: note: expanded from macro 'WTF_SIGNPOST_EVENT_EMIT_FUNC_CASE_LABEL' 47 | emitFunc(log, signpostIdentifier, #name, "pid: %d | %{public}s" timeFormat, pid, logString, timestamp); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Volumes/Data/webkit/Source/WTF/wtf/cocoa/SystemTracingCocoa.cpp:27: In file included from /Volumes/Data/webkit/Source/WTF/wtf/SystemTracing.h:260: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include/os/signpost.h:227:9: note: expanded from macro 'os_signpost_interval_begin' 227 | os_signpost_emit_with_type(log, OS_SIGNPOST_INTERVAL_BEGIN, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 228 | interval_id, name, ##__VA_ARGS__) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include/os/signpost.h:398:9: note: expanded from macro 'os_signpost_emit_with_type' 398 | _os_signpost_emit_with_type(_os_signpost_emit_with_name_impl, log, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 399 | type, spid, name, ##__VA_ARGS__) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include/os/signpost.h:390:13: note: expanded from macro '_os_signpost_emit_with_type' 390 | OS_LOG_CALL_WITH_FORMAT_NAME((emitfn), \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 391 | (&__dso_handle, _log_tmp, _type_tmp, _spid_tmp), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 392 | name, "" __VA_ARGS__); \ | ~~~~~~~~~~~~~~~~~~~~~ ```
Attachments
Ryosuke Niwa
Comment 1 2026-01-29 09:44:32 PST
EWS
Comment 2 2026-01-30 23:28:13 PST
Committed 306552@main (ca919f13d3de): <https://commits.webkit.org/306552@main> Reviewed commits have been landed. Closing PR #57489 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-01-30 23:29:15 PST
Note You need to log in before you can comment on or make changes to this bug.