7557 Commits

Author SHA1 Message Date
Murat Toprak
2c307e2839 fix resizing error in allocator_move_impl 2025-07-31 23:28:17 +03:00
Murat Toprak
b15bbdcb23 Add test cases for the updated move ctor
- Added two test cases `move_ctor_inline_buffer_non_propagating` and `move_ctor_dynamic_buffer_non_propagating`
- Added `PropageteOnMove` template parameter to `allocator_ref` class to be compatible with the old test cases
- `allocator_ref` now implements `!=` and `==` operators
2025-07-31 23:13:20 +03:00
Murat Toprak
a543d79c5c Update move ctor to be C++11 compatible and minor fixes 2025-07-31 23:13:20 +03:00
Murat Toprak
5deae85b18 Handle allocator propagation in basic_memory_buffer::move
Update `basic_memory_buffer::move` to respect `propagate_on_container_move_assignment`allocator trait.
If the allocator should not propagate and differs from the target's allocator,
fallback to copying the buffer instead of transferring ownership.

This avoids potential allocator mismatch issues and ensures exception safety.
2025-07-31 23:13:20 +03:00
Victor Zverovich
93f03953af Optimize the default FP formatting 2025-07-27 08:56:07 -07:00
Dominic Pöschko
35dcc58263
fix buffer overflow on all emphasis flags set (#4498) 2025-07-20 10:43:33 -07:00
Catherine
553ec11ec0
Make compatible with WASI (#4497)
WASI is a POSIX subset that doesn't have `dup`, `dup2`, or `pipe` system calls.

Fixes #4496.
2025-07-14 15:51:04 -07:00
autoantwort
a0ecfe3e1c
msvc + ninja + modules: Fix build when consuming fmtlib while using a Ninja generator (#4495)
Co-authored-by: Leander Schulten <Leander.Schulten@tetys.de>
2025-07-13 10:28:00 -07:00
Victor Zverovich
127413ddaa
Add OpenSSF Best Practices badge 2025-07-12 07:12:18 -07:00
Victor Zverovich
7d29ebe4af Minor cleanup 2025-07-12 07:09:38 -07:00
anonymous
20c8fdad06
Fix import std in clang++ (#4488)
fix module-compilation error when defined `FMT_IMPORT_STD`
2025-07-07 11:47:48 -07:00
Victor Zverovich
300ce75ca6 Handle invalid glibc FILE buffer 2025-07-06 11:17:16 -07:00
Victor Zverovich
513f978241 Cleanup os-test 2025-07-04 10:52:59 -07:00
Victor Zverovich
6a3b40524c Use actual example code and move safe_fopen to os-test 2025-07-04 09:50:55 -07:00
Victor Chernyakin
2fa3e1a1bb
Fix interaction between debug presentation, precision, and width for strings (#4478) 2025-07-04 07:33:47 -07:00
dependabot[bot]
fc8d07cfe5
Bump msys2/setup-msys2 from 2.27.0 to 2.28.0 (#4485)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](61f9e5e925...40677d36a5)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-01 08:42:01 -07:00
Miuna
27c5aab349
Fix unwanted char promotion in decimal writer with wchar_t (#4483) 2025-07-01 07:03:57 -07:00
Victor Zverovich
bc0193535a Update image 2025-06-29 07:50:09 -07:00
Miuna
353bd895a2
Add FMT_EXPORT on ranges.h customization points (#4476) 2025-06-24 10:30:44 -07:00
Tomek-Stolarczyk
953cffa701
Replace memset with constexpr fill_n in bigint::align (#4471)
Use fill_n in place of memset in bigint::align to respect constexpr.
2025-06-23 16:18:16 -07:00
Vladislav Shchapov
571c02d475
Add xchar support for std::byte formatter (#4480)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2025-06-23 14:02:11 -07:00
Remy Jette
f4345467fc
Fix compilation on clang-21 / libc++-21 (#4477)
`<cstdlib>` was not being included, so malloc and free were only declared
via transitive includes. Some includes changed in the latest libc++-21
build which broke fmt.

Also changed `malloc`/`free` to `std::malloc` and `std::free`, as
putting those symbols in the global namespace is optional for the
implementation when including `<cstdlib>`.
2025-06-21 07:28:14 -07:00
Victor Chernyakin
1ef8348070
Properly constrain detail::copy optimization (#4474) 2025-06-21 06:59:35 -07:00
Sahil Sinha
a5dccffa56 Add double and float support to scan test
- Add double_type and float_type to scan_type enum
- Add double* and float* pointers to scan_arg union
- Add constructors for double and float scan arguments
- Add switch cases for double and float types in visit()
- Implement basic read() functions for floating-point parsing

This partially resolves the TODO comment 'more types' in scan.h by adding
support for the two most commonly needed floating-point types.
2025-06-21 06:57:20 -07:00
Victor Zverovich
4a149f513f Test non-SSO constexpr string formatting 2025-06-20 07:10:12 -07:00
Victor Chernyakin
067bc479b4
Avoid redundant work when processing UTF-8 strings (#4475) 2025-06-20 06:39:06 -07:00
Victor Zverovich
730fd4d9a7 Remove redundant tests 2025-06-08 08:46:22 -07:00
Mikhail Svetkin
5860688d7e
Enable constexpr support for fmt::format (fmtlib#3403) (#4456) 2025-06-07 07:16:49 -07:00
Victor Zverovich
46be88bc1e Cleanup FP formatting 2025-06-01 09:15:20 -07:00
Thomas Khyn
cc88914904
Export fmt::dynamic_format_arg_store in fmt module (#4459) 2025-06-01 08:50:14 -07:00
Victor Zverovich
fc0c76a075 Handle large precision 2025-06-01 08:49:41 -07:00
dependabot[bot]
6332a38529
Bump ossf/scorecard-action from 2.4.0 to 2.4.2 (#4462)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](62b2cac7ed...05b42c6244)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-01 08:48:36 -07:00
Victor Zverovich
02de29e003 Remove a reference to a compromised account 2025-05-30 18:24:56 -07:00
Victor Zverovich
6d51c78c1e Cleanup FP formatting 2025-05-30 16:45:21 -07:00
Victor Zverovich
0f4e9d0bde Cleanup FP formatting 2025-05-30 16:05:57 -07:00
Victor Zverovich
d9d50495ac Optimize the default FP formatting 2025-05-30 13:45:04 -07:00
Victor Zverovich
befbc5fdb8 Fix ADL lookup for memory_buffer 2025-05-26 09:44:35 -07:00
Victor Zverovich
8aa1d6a9fb Minor cleanup 2025-05-25 10:14:24 -07:00
Nikhil
6d79757a38
Interpret precision as display width (#4443) 2025-05-25 08:42:47 -07:00
Victor Zverovich
1ff0b7f5e1 Cleanup warning suppression 2025-05-24 09:37:01 -07:00
Edoardo Morandi
ea985e84f8
Remove some implicit conversions (#4447)
* fix: avoid an implicit cast

The "1" used for the bitshift is treated as int, and this causes an
implicit conversion to `UInt` when performing the logical and.
Explicitly casting the number to `UInt` avoids the warning.

* fix: avoid implicit conversions for indices

Some indices in `include/fmt/base.h` are expressed as `int` types, which
causes an implicit conversion to a `size_t` when they are actually used
as index. Explicitly casting the value avoids the warning.

* fix: avoid an implicit conversion using size_t

The number of bits is used to express the size of a buffer. Using an
`int` causes an implicit conversion warning, let's use a `size_t` which
is the right type for the job.
2025-05-24 09:22:03 -07:00
Andreas Reischuck
f7033da09e
Avoid include locale inline if C++20 modules are enabled (#4451)
MSVC hints with:
```
fmt\include\fmt\format-inl.h(26): warning C5244: '#include <locale>' in the purview of module 'fmt' appears erroneous.  Consider moving that directive before the module declaration, or replace the textual inclusion with 'import <locale>;'.
```

Then fails the build with `type redefinition`.
2025-05-21 17:18:18 -07:00
Tobias Schlüter
b723c021df
Give useful error when misusing fmt::ptr. (#4453)
static_assert(bla, "") prints an empty message but not the condition with at least MSVC. Add an informative message.
2025-05-20 12:21:06 -07:00
Victor Zverovich
3ba3c390fb Clarify that formatting of pointers is disallowed 2025-05-17 10:16:58 -07:00
Kefu Chai
ab161a71c6
Fix some typos in comments (#4448)
- s/instantion/instantiation/
- s/uninitalized/uninitialized/
- s/costexpr/constexpr/

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-05-15 06:28:14 -07:00
Victor Chernyakin
b5266fd3b9
Remove some redundant consts (#4445)
`constexpr` variables are implicitly `const`.
2025-05-12 10:41:58 -07:00
Victor Zverovich
9b0ebd4435 Cleanup base-test 2025-05-11 15:42:08 -07:00
Victor Zverovich
7af94e5597 Remove old gcc workaround 2025-05-11 12:35:28 -07:00
Victor Zverovich
2924fcf8f6 Cleanup base-test 2025-05-11 10:36:42 -07:00
Victor Zverovich
102752ad45 Update docs 2025-05-11 09:13:12 -07:00