Fix -Wnonnull build failure in TypedStats: value-initialize last_seen_val - #70
Open
z0mz0m wants to merge 1 commit into
Open
Fix -Wnonnull build failure in TypedStats: value-initialize last_seen_val#70z0mz0m wants to merge 1 commit into
z0mz0m wants to merge 1 commit into
Conversation
TypedStats<PT> is explicitly instantiated for every PT in FLS_ALL_CTS, including str_pt. The member initializer last_seen_val(0) therefore instantiates as std::string(0) == std::string(nullptr), which is undefined behaviour; clang 21 diagnoses it as -Wnonnull and the build fails under -Werror: src/table/stats.cpp:17:21: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] Value-initializing instead gives 0 for the arithmetic instantiations and an empty string for str_pt, with no behaviour change for the numeric types. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
z0mz0m
force-pushed
the
fix/typedstats-string-value-init
branch
from
July 27, 2026 10:22
63e1a56 to
0cb51f8
Compare
z0mz0m
added a commit
to Zetta-Zip/FastLanes
that referenced
this pull request
Jul 27, 2026
TypedStats<PT> is instantiated for str_pt via FLS_ALL_CTS, so last_seen_val(0) instantiated as std::string(nullptr) — UB, and fatal under -Werror with clang 21's -Wnonnull. Upstream PR: cwida#70 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
TypedStats<PT>is explicitly instantiated for everyPTinFLS_ALL_CTS, includingstr_pt. The member initializerlast_seen_val(0)therefore instantiates asstd::string(0)==std::string(nullptr), which is undefined behaviour. Clang 21 diagnoses it and, with the project's-Werror, the build fails:Value-initializing with
{}yields0for the arithmetic instantiations and an empty string forstr_pt, so there is no behaviour change for the numeric types.Reproduced on: macOS 15 / arm64, Apple clang 21,
pip install .(scikit-build-core, Release). With this one-line change the wheel builds and a CSV ->.fls-> CSV roundtrip over ~112k rows x 7 BIGINT columns is byte-identical.🤖 Generated with Claude Code