Fix #11620 - Remove fmt for formatting ranges, and std::filesystem::path and PyStatus #11628
Merged
Conversation
|
|
|
48de45a to
0b5df51
Compare
|
|
|
f35c5f6 to
e1b437d
Compare
… a range (C++26), std::print (C++23)
For the string one, I went with the same behavior as fmt
```
std::vector<std::string> v{"element1", "element2", "element3"};
fmt::print("{}\n", v);
=> ["element1", "element2", "element3"]
```
…of std::set as {1, 2, 3} not [1, 2, 3]
+ one <fmt/ranges.h> usage
I used a Clang LibTooling-based refactoring tool that I created to do so: https://github.com/jmarrec/EnergyPlus-fmt-clang-refactoring/blob/main/path_format_fixer.cpp
WaterThermalTanks I handled manually
…cly expose Formatters.hh 25c60c2
…iling return cf llvm/llvm-project#66466 (comment) CI test_pull_requests.yml uses macos-14, with XCode 15.4, so that's like around Clang 16 or 17...
u64toa writes digits into the buffer but does NOT null-terminate — it relies on the = {} zero-initialization. So s IS a valid null-terminated string. The bug is that std::format("{}", s) where s is char[129] — on Apple's libc++ (arm64) the char[N] array type isn't decaying to const char*, it's being matched as a range and outputting all 129 bytes including the null padding.
decent CI has error third_party/milo/dtoa.h:161:14 ‘memmove’ is not a member of ‘std’; did you mean ‘wmemmove’?
Contributor
Author
|
@mitchute Ok CI is finally clean (I rebased onto develop and pushed again). Note: gcc-13.3-UnitTestsCoverage-RelWithDebInfo had failed but it was unrelated, probably an out of memory error in GCC
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull request overview
Description of the purpose of this PR
Move formatters for std::filesystem::path and PyStatus to std::formatter.
I used a custom build Clang Tool: https://github.com/jmarrec/EnergyPlus-fmt-clang-refactoring
it detects any
fmt::format,EnergyPlus::format,std::formatwith afs::pathargument chained to.string()or.generic_string()and drops that to just{}or{:g}respectively, withstd::formatas the function called.I eliminated all
fmt::to_string,fmt::format_int, and alsofmt::formatexcept the IOFiles ones.Pull Request Author
Reviewer