Skip to content

Fix -Wmaybe-uninitialized error in lp_value_mul - #118

Merged
ahmed-irfan merged 1 commit into
masterfrom
fix-value-mul-maybe-uninitialized
Nov 19, 2026
Merged

ahmed-irfan merged 1 commit into
masterfrom
fix-value-mul-maybe-uninitialized

Conversation

@ahmed-irfan

Copy link
Copy Markdown
Member

CI on current ubuntu runners fails to build with GCC:

src/number/value.c:1280:25: error: 'a_to_use' may be used uninitialized [-Werror=maybe-uninitialized]
src/number/value.c:1292:5: error: 'b_to_use' may be used uninitialized [-Werror=maybe-uninitialized]

(seen on the CI run for #117). GCC cannot prove lp_value_to_same_type sets both pointers on every path. This initialises them to a and b, which is exactly what the same-type path assigns, so behaviour is unchanged.

Testing: ctest passes (16/16) on Apple clang, Release. I could not reproduce the warning locally (gcc-15 on macOS does not emit it, even on the unmodified file), so CI on this PR is the real check.

🤖 Generated with Claude Code

GCC on current CI runners reports -Wmaybe-uninitialized for these
pointers (turned into an error by -Werror) because it cannot prove
lp_value_to_same_type sets them on every path. Default them to the
original operands, which is what the same-type path assigns anyway.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ahmed-irfan
ahmed-irfan merged commit 885f257 into master Nov 19, 2026
16 checks passed
@ahmed-irfan
ahmed-irfan deleted the fix-value-mul-maybe-uninitialized branch November 19, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant