zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.73k stars 6.55k forks source link

[Coverity CID :210605] Incompatible cast in tests/lib/cmsis_dsp/filtering/src/misc_f32.c #25770

Closed zephyrbot closed 4 years ago

zephyrbot commented 4 years ago

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/4653b4e63f886a50ac7b72f8d47ba2950ab2dd0d/tests/lib/cmsis_dsp/filtering/src/misc_f32.c#L105

Category: Integer handling issues Function: test_arm_conv_f32 Component: Tests CID: 210605

Details:

99         float32_t *output;
100    
101         /* Allocate output buffer */
102         output = calloc(ref_length, sizeof(float32_t));
103    
104         /* Run test function */
>>>     CID 210605:  Integer handling issues  (INCOMPATIBLE_CAST)
>>>     Pointer "in_com1" 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.
105         arm_conv_f32(
106             (float32_t *)in_com1, in1_length,
107             (float32_t *)in_com2, in2_length, output);
108    
109         /* Validate output */
110         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.

stephanosio commented 4 years ago

Intentional-Ignore

For more details, refer to the Coverity history.