fix: silence Coverity UNUSED_VALUE in __create_descriptor_1d - #365
Draft
antonwolfy wants to merge 2 commits into
Draft
fix: silence Coverity UNUSED_VALUE in __create_descriptor_1d#365antonwolfy wants to merge 2 commits into
antonwolfy wants to merge 2 commits into
Conversation
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
force-pushed
the
fix/coverity-unused-value-dfti-free
branch
from
August 10, 2026 11:42
b8efc24 to
59f1178
Compare
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.
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 byDftiFreeDescriptoris stored intostatusbut consumed only by the debug-onlyassert(status == 0). UnderNDEBUGthe assert is compiled out, so the store is dead before the unconditionalstatus = 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.