typedef struct {
int v1;
} s1_t;
static s1_t s1;
void test(s1_t s2) {
s1.v1 = s2.v1;
s1.v1++; //To avoid unused warning
}
Command:
C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl -mv7R4 --code_state=32 --float_support=VFPv3D16 -O4 --check_misra="17.6" -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_17_6.c
Output:
"misra_17_6.c", line 8: error #1423: (MISRA-C:2004 17.6/R) The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist ("s2")
1 error detected in the compilation of "misra_17_6.c".
There is not address assignment! This error misreported for halcogen generated code. For sample - sys_dma.c