WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
270769
[JSC] DatePrototype.cpp(337,29): error: 'snprintf' will always be truncated; specified size is 28, but format string expands to at least 29 [-Werror,-Wformat-truncation]
https://bugs.webkit.org/show_bug.cgi?id=270769
Summary
[JSC] DatePrototype.cpp(337,29): error: 'snprintf' will always be truncated; ...
Fujii Hironori
Reported
2024-03-10 13:44:25 PDT
Clang 18.0.1 reports an warning for Windows port. In file included from C:\w\WebKitBuild\Debug\JavaScriptCore\DerivedSources\unified-sources\UnifiedSource-f2e18ffc-8.cpp:1: C:\PSDEV\wc\Source\JavaScriptCore\runtime/DatePrototype.cpp(337,29): error: 'snprintf' will always be truncated; specified size is 28, but format string expands to at least 29 [-Werror,-Wformat-truncation] 337 | charactersWritten = snprintf(buffer, sizeof(buffer), "%+07d-%02d-%02dT%02d:%02d:%02d.%03dZ", gregorianDateTime->year(), gregorianDateTime->month() + 1, gregorianDateTime->monthDay(), gregorianDateTime->hour(), gregorianDateTime->minute(), gregorianDateTime->second(), ms); | ^ 1 error generated.
Attachments
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2024-03-10 14:23:53 PDT
Seems like this issue. -Wformat-truncation warning size does not agree with the return value from snprintf · Issue #71320 · llvm/llvm-project
https://github.com/llvm/llvm-project/issues/71320
Fujii Hironori
Comment 2
2024-03-10 14:47:36 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/25692
EWS
Comment 3
2024-03-11 13:25:15 PDT
Committed
275926@main
(65fd9be34cc1): <
https://commits.webkit.org/275926@main
> Reviewed commits have been landed. Closing PR #25692 and removing active labels.
Radar WebKit Bug Importer
Comment 4
2024-03-11 13:26:16 PDT
<
rdar://problem/124404812
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug