https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114325
Bug ID: 114325
Summary: std::format gives incorrect results for negative
numbers
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: luigighiron at gmail dot com
Target Milestone: ---
The following code generates an incorrect result with libstdc++:
std::format("{}",-100)
>From testing on godbolt this seems to generate the string "-1\0000", then when
printed it looks like -10. This seems exclusive to GCC 14, and happens for any
numbers less than -99.