ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.33k stars 1.08k forks source link

CMSIS-DSP: warning "statement is unreachable" #1244

Closed escherstair closed 3 years ago

escherstair commented 3 years ago

When some of the tables are not included, as described here, the compiler gives warnings "statement is unreachable". As an example, when none of the f64 tables is included, the following lines are unreachable: https://github.com/ARM-software/CMSIS_5/blob/999d63b1476c53374ff65b23710d8f3d2c482323/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c#L337-L338 This is because of https://github.com/ARM-software/CMSIS_5/blob/999d63b1476c53374ff65b23710d8f3d2c482323/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c#L333-L334 But the line https://github.com/ARM-software/CMSIS_5/blob/999d63b1476c53374ff65b23710d8f3d2c482323/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c#L334 should be changed to break; so that https://github.com/ARM-software/CMSIS_5/blob/999d63b1476c53374ff65b23710d8f3d2c482323/CMSIS/DSP/Source/TransformFunctions/arm_rfft_fast_init_f64.c#L337-L338 is executed and ARM_MATH_ARGUMENT_ERROR is returned.

christophe0606 commented 3 years ago

@escherstair Thank for reporting this.

With cmake build when none of the table is included, the file is not compiled. But with Pack or Make it is not the case so this should be corrected.

I'll check other inits in case similar issue is present.

christophe0606 commented 3 years ago

Corrected in commit https://github.com/ARM-software/CMSIS_5/commit/6df0592c465a4aca479cfd597786b3b6307b99ff