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 :210613] Incompatible cast in tests/benchmarks/cmsis_dsp/basicmath/src/f32.c #25773

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/benchmarks/cmsis_dsp/basicmath/src/f32.c#L340

Category: Integer handling issues Function: test_benchmark_vec_dot_prod_f32 Component: Tests CID: 210613

Details:

334         float32_t output;
335    
336         /* Begin benchmark */
337         benchmark_begin(&irq_key, &timestamp);
338    
339         /* Execute function */
>>>     CID 210613:  Integer handling issues  (INCOMPATIBLE_CAST)
>>>     Pointer "input2" 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.
340         arm_dot_prod_f32(
341             (float32_t *)input1, (float32_t *)input2, PATTERN_LENGTH,
342             &output);
343    
344         /* End benchmark */
345         timespan = benchmark_end(irq_key, timestamp);

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.