Repository navigation
Conversation
Avoid `-Wc2y-extensions` on Clang 22
See error: > error: 'DoNotOptimize<bool>' is deprecated: The const-ref version of this method can permit undesired compiler optimizations in benchmarks
It detects a theoretical UB in Boost.Test
In the loop it wrongly shows: > error: writing 16 bytes into a region of size 15 [-Werror=stringop-overflow=]
Also works around a `Wformat-truncation` in GCC 15 Closes #2022
Flow86
reviewed
Nov 22, 2026
| const auto s = std::chrono::duration_cast<std::chrono::seconds>(time % std::chrono::minutes(1)); | ||
| snprintf(buf, sizeof(buf), "%03ld:%02ld:%02ld", static_cast<long>(h.count()), static_cast<long>(m.count()), | ||
| static_cast<long>(s.count())); | ||
| const int ct = snprintf(buf, sizeof(buf), "%03ld:%02ld:%02ld", static_cast<long>(h.count()), |
Member
There was a problem hiding this comment.
maybe we should use the platform independed PRI... (e.g PRIu64) suffixes from cinttypes instead? we could remove the static_cast's then
Member
Author
There was a problem hiding this comment.
std::chrono::hours etc has no defined underlying type. E.g. for hours it just says "at least 23 bits". So we need the casts anyway
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.
GCC 15 seems to have a few false positives, so add to CI
Not using the test-PPA avoids potential failures by network flukes