Victor Zverovich
18164eaf8b
Simplify printf flag tests
...
The sign is cleared for unsigned conversions regardless of whether the
'+' or the space flag was given, so "% o" and "% X" only repeat what
"%+o" and "%+X" already cover.
2026-10-17 07:16:33 -07:00
fhgffy
01bef95d34
Ignore '+' and space flags for unsigned printf conversions ( #4977 )
...
C only applies the '+' and space flags to signed conversions, so
fmt::sprintf("%+u", 42) should give "42" like printf does, not "+42".
The same goes for %o, %x and %X.
2026-10-17 07:11:43 -07:00
Victor Zverovich
6d71f74624
Remove redundant printf tests
...
%.0i and %.0u take the same path as %.0d because 'i' and 'u' are normalized
to 'd', the uppercase variants only set the upper flag which is unobservable
when there are no digits, and %-5.0d cannot be distinguished from %5.0d
because the output is empty.
2026-09-20 17:30:26 -07:00
Sachit Madaan
cfb57bfa3a
Fix printf conversion of a zero value with a precision of zero ( #4942 )
2026-09-19 07:49:15 -07:00
aizu-m
128ba144ab
fix out-of-bounds read in basic_format_args::get ( #4800 )
2026-06-09 22:18:35 -07:00
Victor Zverovich
46cf422f54
Unify copyright notices
2026-05-31 08:54:06 -07:00
Raúl Marín
4ccf1d4faf
Fix out-of-bounds read in vprintf with trailing '%' ( #4742 )
2026-04-10 12:23:57 -07:00
Kağan Can Şit
9396f77fe4
Remove unused header includes in test files ( #4729 )
2026-04-05 18:40:48 -07:00
Victor Zverovich
dc05bee307
Don't assume nul termination in printf
...
Thanks ZUENS2020 for reporting.
2026-03-23 13:28:26 -07:00
Victor Zverovich
45f230b9b2
Remove const_check
2026-01-29 20:18:18 -08:00
Kareem Otoum
6b018edfb9
add support for positional arguments as width and precision specifiers ( #4643 )
...
* make positional arguments work as width and precision specifiers with floating-point formats too
* fix test case failing ci tests
2026-01-04 16:39:02 -08:00
Victor Zverovich
bfdef8b15d
Remove deprecated functions
2025-09-13 09:25:53 -07:00
toge
9d946a2fc4
Fix compilation errors due to make_format_args in gcc 14.1.1 with c++20 ( #4042 )
2024-07-03 12:41:08 -07:00
Victor Zverovich
d70729215f
Fix constness
2024-01-14 06:44:38 -08:00
Victor Zverovich
971f7ae768
Minor cleanup
2024-01-10 16:43:00 -08:00
Victor Zverovich
fb66131efa
Improve arg storage
2024-01-08 21:25:41 -08:00
Victor Zverovich
c142385033
Improve the pipe API
2024-01-01 15:55:37 -08:00
Victor Zverovich
8e6b2541a6
Apply coding conventions
2023-12-30 16:07:35 -08:00
Victor Zverovich
821f8cdb45
Detemplatize printf more
2023-05-17 12:34:12 -07:00
Victor Zverovich
2f605cc896
Deprecate wide printf
2023-05-17 08:58:55 -07:00
Victor Zverovich
5780269d57
Improve API safety
2023-05-11 10:19:56 -07:00
Victor Zverovich
71e4e02722
Cleanup vprintf
2023-01-02 08:37:00 -08:00
Victor Zverovich
ffb9b1d13c
Improve handling of signed types
2022-12-30 10:31:39 -08:00
Vladislav Shchapov
31364732dc
Replace snprintf-based hex float formatter with internal implementation
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-11-24 07:15:46 -08:00
Victor Zverovich
0c06c81da8
Deprecated implicit conversion of enums to ints for consistency with scoped enums
2022-07-03 09:02:22 -07:00
Victor Zverovich
f055ebbd25
Make ostream operators opt in to reduce the risk of ODR violations
2022-02-04 15:06:45 -08:00
Victor Zverovich
1b193e7b37
Deprecate more
2022-01-03 11:13:09 -08:00
Victor Zverovich
e421d52713
Simplify error handling in parse_nonnegative_int
2021-06-14 16:05:37 -07:00
Victor Zverovich
2039dce75f
Detect consteval
2021-06-07 06:57:43 -07:00
Victor Zverovich
76ee490468
Move wchar/custom char overloads to xchar.h
2021-06-05 22:57:45 -07:00
Victor Zverovich
d338d66324
Cleanup the printf implementation
2021-06-01 19:30:46 -07:00
Victor Zverovich
34b8acaef7
More wchar_t-specific API to wchar.h
2021-05-21 18:24:39 -07:00
Victor Zverovich
9c3af11a92
Cleanup tests
2021-05-05 18:31:41 -07:00
Victor Zverovich
c738c3431f
Cleanup tests
2021-05-04 17:23:13 -07:00
Victor Zverovich
c9c0e5077d
Cleanup tests
2021-04-30 06:42:38 -07:00
Victor Zverovich
b9ab5c8836
Remove printf.h dependency on ostream.h
2021-04-23 10:42:57 -07:00
Victor Zverovich
6e1fc01752
Move detail::truncating_iterator to fmt/compile.h
2021-03-06 08:35:36 -08:00
rimathia
95c6ac0cc8
fix typo which caused the loss of the counting information when using a printf context with a truncating_iterator
2020-06-05 07:37:54 -07:00
Victor Zverovich
3245145a41
Remove undocumented buffer_range and output_range
2020-05-30 13:07:52 -07:00
rimathia
8c8f74a870
fix zero flag for char types and make zero flag ignored if a precision is specified
2020-05-23 12:46:26 -07:00
rimathia
6b219a58db
fix interaction of space flag and '+' flag, as well as '-' flag and '0' flag ( #1687 )
2020-05-17 04:27:18 -07:00
rimathia
96c18b26c2
make plus flag for printf not be ignored for char argument ( #1683 )
...
* make plus flag for printf not be ignored for char argument
* clarify overwriting of alignment specifiers for printf with char argument
2020-05-15 06:45:51 -07:00
Victor Zverovich
8069265373
internal -> detail ( #1538 )
2020-05-10 07:34:30 -07:00
Victor Zverovich
7f723fbcb8
Consistently namespace qualify size_t
2020-05-07 15:59:46 -07:00
Victor Zverovich
0463665ef1
Don't access a C string past precision in printf ( #1595 )
2020-04-22 17:10:23 -07:00
Victor Zverovich
8a4630686e
Improve handling of named arguments
2020-04-14 11:56:55 -07:00
Victor Zverovich
e99809f29d
Fix ostream support in sprintf ( #1631 )
2020-04-12 07:53:17 -07:00
Victor Zverovich
7d01859ef1
Fix handling of unsigned char strings in printf
2020-04-08 13:05:42 -07:00
Victor Zverovich
f72a905eb3
Fix handling of volatile enums
2020-03-11 08:40:57 -07:00
Victor Zverovich
8cf4c52068
Apply clang-format
2019-12-21 13:10:45 -08:00