Bug 270769

Summary: [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]
Product: WebKit Reporter: Fujii Hironori <fujii.hironori>
Component: JavaScriptCoreAssignee: Fujii Hironori <fujii.hironori>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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
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
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
Note You need to log in before you can comment on or make changes to this bug.