Use unsigned literals where the element type is unsigned
A bare {1, 2, 3, 4, 5} deduces initializer_list<int>, and the
sign-changing conversion to each std::uint64_t element trips Clang's
-Wconversion under -Werror, failing the Linux analysis build.
MSVC /W4 /WX does not diagnose this, and GCC's -Wconversion does not warn
when a constant value is known to fit, so the local checks and the GCC
Release job both passed. Only Clang caught it.
Reproducing Clang's diagnostic locally was not possible: clang-tidy does
not honour the warning flags in its cl driver mode and no clang driver is
installed on this host. The tree was audited by hand for the pattern
instead. Every other range-for over a braced literal list either deduces
through auto or already carries suffixes matching its declared type, so
this was the only instance. That audit catches this one, not the next
one, and the standing gap is recorded in the validation report: no Clang
or GCC compile happens here before a push.
Native Release, clang-tidy analysis and format checks pass 21/21.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -697,6 +697,23 @@ original's terminal record and that a moved-from archive still holds everything.
|
||||
All four static assertions were confirmed to fail with the deleted assignments
|
||||
removed.
|
||||
|
||||
Linux CI on `29ce255` reported one build blocker (2026-09-23), the first Linux
|
||||
result recorded since `b01a824`. GCC Release passed 21/21, then the Clang 19
|
||||
analysis build failed: a bare `{1, 2, 3, 4, 5}` deduces `initializer_list<int>`
|
||||
and the sign-changing conversion to each `std::uint64_t` element trips
|
||||
`-Wconversion` under `-Werror`. The literals are now unsigned.
|
||||
|
||||
MSVC `/W4 /WX` does not diagnose this, and GCC's `-Wconversion` does not warn when
|
||||
a constant value is known to fit, so neither the local checks nor the GCC job
|
||||
could have caught it; only Clang did. Attempting to reproduce Clang's diagnostic
|
||||
locally through clang-tidy failed, because the warning flags are not honoured in
|
||||
its cl driver mode and no clang driver is installed on this host. The whole tree
|
||||
was instead audited by hand for the pattern: every other range-for over a braced
|
||||
literal list either deduces through `auto` or already carries suffixes matching
|
||||
its declared type, and this was the only instance. That audit is a one-off, not a
|
||||
check that will catch the next one; the standing gap is that no Clang or GCC
|
||||
compile happens on this host before a push.
|
||||
|
||||
Nothing is serialized, so no history survives a process, and no fixture calls any
|
||||
of this. Terminal extinction is not claimed anywhere, durable retention and
|
||||
migration are M7 and M8, and NPC mutation remains undecided. Golden
|
||||
|
||||
@@ -151,7 +151,9 @@ void death_is_terminal_and_births_are_unique() {
|
||||
void absence_is_never_reported_as_extinction() {
|
||||
auto archive = branching();
|
||||
// Nothing was ever born: every lineage is absent, and none is extinct.
|
||||
for (const std::uint64_t genome : {1, 2, 3, 4, 5}) {
|
||||
// Unsigned literals: a bare list deduces initializer_list<int>, and the
|
||||
// sign-changing conversion to each element fails Clang's -Wconversion.
|
||||
for (const std::uint64_t genome : {1U, 2U, 3U, 4U, 5U}) {
|
||||
CHECK(*archive.status(genome) == LineageStatus::absent);
|
||||
CHECK(*archive.living_carriers(genome) == 0);
|
||||
CHECK(archive.find(genome)); // Still retained regardless.
|
||||
|
||||
Reference in New Issue
Block a user