-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<format>
: Misbehavior for huge strings
#4479
Comments
The Standard doesn't say so, but MSVC STL, fmtlib (source code), and libc++ (source code) all throw a Lines 1645 to 1654 in d6efe94
|
Would fixing this need to break ABI as we've already stored STL/stl/inc/__msvc_formatter.hpp Lines 98 to 99 in d6efe94
(C++23 formatters can probably be fixed because ABI-breakage is still allowed.) |
We talked about this at the weekly maintainer meeting and we think we should throw an exception for these pathological cases, followed by reconsidering the |
We already throw an exception if the width is too large, and we don't need to reject oversized strings: there will simply be no padding if the string is longer than the requested width. I can't check right now, but I think the string formatter already works correctly using |
Noticed while reviewing #4438, but affects
main
. I don't see any Standardese allowing us to assume that sizes and widths can fit in anint
.The text was updated successfully, but these errors were encountered: