Skip to content

fix: silence Coverity UNUSED_VALUE in __create_descriptor_1d - #365

Draft
antonwolfy wants to merge 2 commits into
masterfrom
fix/coverity-unused-value-dfti-free
Draft

fix: silence Coverity UNUSED_VALUE in __create_descriptor_1d#365
antonwolfy wants to merge 2 commits into
masterfrom
fix/coverity-unused-value-dfti-free

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

The PR resolves the Coverity UNUSED_VALUE (CWE-563) findings in __create_descriptor_1d_*.

On the reallocate: path in mkl_fft/src/mklfft.c.src, the value returned by DftiFreeDescriptor is stored into status but consumed only by the debug-only assert(status == 0). Under NDEBUG the assert is compiled out, so the store is dead before the unconditional status = 0; reset — which Coverity flags.

The behavior is correct as written (the old handle's free status is irrelevant since a fresh descriptor is built next). This marks the value as intentionally unused with (void)status; to make the intent explicit and clear the finding.

The value returned by DftiFreeDescriptor on the reallocate path is
consumed only by a debug-only assert(status == 0). Under NDEBUG the
assert is stripped, so the store is dead before the unconditional
status = 0 reset, which Coverity flags as UNUSED_VALUE (one CID per
.c.src template instantiation). Mark the value as intentionally unused
with (void)status to make the intent explicit and clear the finding.
@antonwolfy antonwolfy self-assigned this Aug 10, 2026
@antonwolfy antonwolfy added this to the 2.4.0 release milestone Aug 10, 2026
@antonwolfy
antonwolfy force-pushed the fix/coverity-unused-value-dfti-free branch from b8efc24 to 59f1178 Compare August 10, 2026 11:42
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