Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coverity CID :210608] Incompatible cast in tests/lib/cmsis_dsp/fastmath/src/f32.c #25771

Closed
zephyrbot opened this issue May 28, 2020 · 1 comment
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/4653b4e63f886a50ac7b72f8d47ba2950ab2dd0d/tests/lib/cmsis_dsp/fastmath/src/f32.c#L108

Category: Integer handling issues
Function: test_arm_sqrt_f32
Component: Tests
CID: 210608

Details:

107         /* Validate output */
108         zassert_true(
109             test_snr_error_f32(length, output, (float32_t *)ref_sqrt,
110                 SNR_ERROR_THRESH),
111             ASSERT_MSG_SNR_LIMIT_EXCEED);
112    
>>>     CID 210608:    (INCOMPATIBLE_CAST)
>>>     Pointer "ref_sqrt" points to an object whose effective type is "unsigned int" (integral) but is dereferenced as a "float" (floating point). The cast will not convert the value of the object.
113         zassert_true(
114             test_close_error_f32(length, output, (float32_t *)ref_sqrt,
115                 ABS_ERROR_THRESH, REL_ERROR_THRESH),
116             ASSERT_MSG_ERROR_LIMIT_EXCEED);
117    
118         /* Free output buffer */
102                 zassert_equal(status, ARM_MATH_SUCCESS,
103                     "square root operation did not succeed");
104             }
105         }
106    
107         /* Validate output */
>>>     CID 210608:    (INCOMPATIBLE_CAST)
>>>     Pointer "ref_sqrt" points to an object whose effective type is "unsigned int" (integral) but is dereferenced as a "float" (floating point). The cast will not convert the value of the object.
108         zassert_true(
109             test_snr_error_f32(length, output, (float32_t *)ref_sqrt,
110                 SNR_ERROR_THRESH),
111             ASSERT_MSG_SNR_LIMIT_EXCEED);
112    
113         zassert_true(

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels May 28, 2020
@stephanosio
Copy link
Member

Intentional-Ignore

For more details, refer to the Coverity history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

2 participants