Bug 306542
| Summary: | Compilation error with -Wunsafe-buffer-usage-in-format-attr-call when using latest Swift toolchain | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | New Bugs | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ryosuke Niwa
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
Pull request: https://github.com/WebKit/WebKit/pull/57489
EWS
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
<rdar://problem/169333660>