This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bug: MISRA-C Rule 12.8 Misreported by arm compiler

#include <stdint.h>

uint16_t test() {
    uint16_t v1=0x4000, v2=0x5000;
    return v1 * v2 >> 19; 	
}

Command line:

C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl --include_path="C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" -mv7R4 --code_state=32 --float_support=VFPv3D16 -O4  --check_misra="12.8" -g --strict_ansi --emit_warnings_as_errors --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi --enum_type=packed --preproc_with_compile misra_12_8.c

Output:

"misra_12_8.c", line 4: error #1407: (MISRA-C:2004 12.8/R) The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand
1 error detected in the compilation of "misra_12_8.c".

uint16_t * uint16_t promoted to int. Int size is 32 bits