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: | JavaScriptCore | Assignee: | 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
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
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
Pull request: https://github.com/WebKit/WebKit/pull/25692
EWS
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
<rdar://problem/124404812>