Several source files contain an early return inside a preprocessor #if/#else block, making the final return statement after #endif unreachable dead code.
IAR Compiler reports this as: Warning[Pe111]: statement is unreachable
The pattern is the same: one preprocessor branch returns early, but a second return sits
after #endif where it can never be reached.
Affected files:
|
return ARM_CMSIS_NN_SUCCESS; |
|
return ARM_CMSIS_NN_SUCCESS; |
|
return ARM_CMSIS_NN_SUCCESS; |
|
return ARM_CMSIS_NN_SUCCESS; |
Example (arm_convolve_even_s4.c):
#if defined(ARM_MATH_MVEI)
// ... main implementation ...
#else
(void)ctx;
// ...
return ARM_CMSIS_NN_NO_IMPL_ERROR; // early return in #else branch
#endif
return ARM_CMSIS_NN_SUCCESS; // unreachable
Suggested fix:
Ensure each preprocessor branch has its own return, and remove the one after #endif:
#if defined(ARM_MATH_MVEI)
// ... main implementation ...
return ARM_CMSIS_NN_SUCCESS;
#else
(void)ctx;
// ...
return ARM_CMSIS_NN_NO_IMPL_ERROR;
#endif
Several source files contain an early return inside a preprocessor #if/#else block, making the final return statement after #endif unreachable dead code.
IAR Compiler reports this as: Warning[Pe111]: statement is unreachable
The pattern is the same: one preprocessor branch returns early, but a second return sits
after #endif where it can never be reached.
Affected files:
CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_even_s4.c
Line 225 in 22080c6
CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_get_buffer_sizes_s8.c
Line 129 in 22080c6
CMSIS-NN/Source/ConvolutionFunctions/arm_depthwise_conv_fast_s16.c
Line 446 in 22080c6
CMSIS-NN/Source/ConvolutionFunctions/arm_depthwise_conv_s8_opt.c
Line 421 in 22080c6
CMSIS-NN/Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s16.c
Line 355 in 22080c6
Example (arm_convolve_even_s4.c):
Suggested fix:
Ensure each preprocessor branch has its own return, and remove the one after #endif: