2174 Commits

Author SHA1 Message Date
user202729
eeff8680ed
Avoid dropping null byte in format string (#4732)
* Avoid dropping null byte in format string

* Add a test for null byte in format string
2026-04-23 09:34:27 -07:00
Victor Zverovich
382609a920 Cleanup module test and CI config 2026-04-14 12:30:21 -07:00
Mathew Benson
8783c3c2d4
enable fmt_module tests by updating module-test.cc (#4702)
- Update g++ module testing to use g++ version 15 instead of 14.
  The module support in version 14 isn't very stable and the module
  testing was not working due to unresolved locale symbols.
- Update CI for linux and macos to add verbosity so its consistent with
  windows.
- Refactor test/CMakeLists.txt to enable testing for modules
- The tests in `module-test.cc` seem to not have been updated in some
  time despite changes in the main library.
- Wide String versions of several tests appear to be deprecated so have
  been removed.
- Refactored tests related to `fmt::format_args` that now requires lvalue
  references as opposed to direct values.
- Remove the none-working code identified in the `module-test.cc` file
  while updating.
2026-04-12 10:07:16 -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
8572a24603 Cleanup CI config 2026-04-02 15:04:00 -07:00
Victor Zverovich
602df7dab8 Simplify copy 2026-03-28 09:33:45 -07:00
Victor Zverovich
dc05bee307 Don't assume nul termination in printf
Thanks ZUENS2020 for reporting.
2026-03-23 13:28:26 -07:00
sunmy2019
ea85b81ccd
Support fmt::runtime with wchar_t in fmt::format_to_n (#4715) 2026-03-21 17:10:17 -07:00
Victor Zverovich
d38881410a Deprecated initializer_list join 2026-03-05 16:42:07 -08:00
Yancey
8277ee6aa0
Update fmt::join to support more character types (#4686) 2026-03-04 08:14:08 -08:00
Victor Zverovich
e090e3ffad Apply cmake-format 2026-03-03 15:49:40 -08:00
Victor Zverovich
eef9ff4938 Fix module test 2026-03-03 12:53:45 -08:00
Victor Zverovich
011b24123b Cleanup module test 2026-03-03 12:30:54 -08:00
Mathew Benson
4e1b170b44
Add Separate CMake Target for C++20 Modules (#4685)
* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

The `add_module_library` function is marked as deprecated as its
functionality is superseded.

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

* Add Separate CMake Target for C++20 Modules

In the same vein as there is the `fmt::fmt-header-only`, `fmt::fmt` and
`fmt::fmt_c` targets, I propose the addition of a new target
`fmt::fmt-module` which will be for the compilation of the FMT_MODULE
library option.

The new target will have the properties requried for Compiling,
Installing and using the C++20 functionality in CMake

Updated the logic for setting the FMT_USE_CMAKE_MODULE flag to check the
versions for Ninja and MSVC according the CMAKE Documents and setting
the FMT_MODULE flag based on this

Fixed the test/CMakeLists.txt file which used the FMT_MODULE flag to
separate the module and non-module library testing, in particular
disableing the module version.

The module testing still needs to be fixed, but the expected behavior of
testing the non-modular version is working.

---------

Co-authored-by: Mathew Benson <mathew@benson.co.ke>
Co-authored-by: ClausKlein <claus.klein@arcormail.de>
2026-03-02 09:11:31 -08:00
Victor Zverovich
dc97113ca1 Cleanup the C API 2026-02-21 17:15:19 -08:00
Soumik15630m
1dc644e021
Add C11 API with type-safe formatting (#4663) (#4671) 2026-02-16 07:06:32 -08:00
Stéén
b35de87ad9
std.h: Allow formatting std::unexpected type. (#4675)
In some cases, people might want to format the std::unexpected type itself,
independent of the value type, this commit makes it possible.

Co-authored-by: Robin Oger <robin.oger.work@gmail.com>
2026-02-11 15:06:59 -08:00
Victor Zverovich
eb99f6eba6 Move std::byte formatter to std.h 2026-02-03 10:16:20 -08:00
Victor Zverovich
b98926b73b uint128_fallback -> uint128 2026-02-02 19:13:14 -08:00
Victor Zverovich
3f98b54bd7 Move _BitInt next to bitref formatter 2026-02-02 17:08:10 -08:00
Victor Zverovich
45ed657df3 Cleanup locking 2026-02-01 11:09:19 -08:00
Victor Zverovich
76d480c6fd Cleanup handling of adaptors 2026-01-31 19:49:52 -08:00
Soumik15630m
5cc5072aa6
Fix range suppresor formatter (#4660) 2026-01-30 06:39:00 -08:00
Victor Zverovich
26c6b1c23d Move copy to format.h 2026-01-29 21:30:20 -08:00
Victor Zverovich
b2a96c6087 Stop doing heroics for pathological user code 2026-01-29 21:12:06 -08:00
Victor Zverovich
45f230b9b2 Remove const_check 2026-01-29 20:18:18 -08:00
Victor Zverovich
04864b1111 Remove unused include 2026-01-04 16:45:17 -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
Jaeheon Shim
46a45990fe
Fix missing named-arg validation for compiled format strings (#4638) 2026-01-03 18:27:32 -08:00
Murat Toğunçhan Düzgün
cbd4fc18c3
test(scan): add basic float scan coverage (#4644) 2026-01-02 14:34:18 -08:00
Victor Zverovich
ec73fb7247 Cleanup gtest cmake config 2025-12-09 18:27:32 -08:00
Zephyr Lykos
2a50a0d808
Remove unused symbol check (#4625)
Fixes: 56d7a8c157c6ff9f98dd53a092d439c736cfe934
Fixes: a3bf40838f6bf9b45544d3d3cd0f6a60e8c7218c
2025-12-08 12:23:37 -08:00
Victor Zverovich
19e4d5ecd9 Fix handling of pointers in format string compilation and FMT_BUILTIN_TYPES=0 2025-12-07 08:07:09 -08:00
bigmoonbit
2727215c11
chore: minor improvement for docs (#4616)
Signed-off-by: bigmoonbit <bigmoonbit@outlook.com>
2025-11-28 12:55:25 -08:00
Victor Zverovich
3391f9e992 Cleanup test 2025-11-22 19:14:32 -08:00
Victor Zverovich
7a0da1c68a Merge compile-time FP tests into other compile-time tests 2025-11-22 07:46:38 -08:00
Victor Zverovich
e3d2174b3c Remove more invalid tests 2025-11-22 07:30:11 -08:00
Victor Zverovich
a6fb4d3b06 Remove invalid tests 2025-11-22 07:00:06 -08:00
Victor Zverovich
1122268510 Make path formatting lossless with WTF-8 2025-11-05 10:59:06 -10:00
Victor Zverovich
33ad559eb8 Fix fuzzer 2025-11-02 07:52:16 -10:00
Victor Zverovich
08d38d6e78 Make error_code formatter debug-enabled 2025-10-19 10:35:45 -07:00
Vladislav Shchapov
85f6ecc7a0
Add format_as support for std::variant and std::expected formatters (#4575)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-10-18 14:05:21 -07:00
Oleksandr Koval
486e7ba579
support std::optional holding cv-qualified types (#4562)
Fixes #4561
2025-10-03 04:40:44 -07:00
Victor Zverovich
bfdef8b15d Remove deprecated functions 2025-09-13 09:25:53 -07:00
Fatih BAKIR
18e160eb4c
Add missing include for crtdbg.h (#4534)
This header uses _CRT_ASSERT, which is defined in crtdbg.h but does not
include it, causing a build error in format-test.cc

Fixes the issue by including the header
2025-09-08 09:37:43 -07:00
Anas
0a94e06750
Combined emphases into a single escape sequence (#4528) 2025-09-05 09:50:56 -07:00
Victor Zverovich
e72e43af1c Apply clang-tidy 2025-09-03 11:05:41 -07:00
Victor Zverovich
882702c219 Apply clang-tidy 2025-09-01 12:21:17 -07:00
Victor Zverovich
02fb76d69b Add FMT_STATIC_FORMAT 2025-09-01 09:15:32 -07:00