Hello everyone,
Target C6678, Compiler 7.4.5
Here's a case where I think the compiler reports a false MISRA 17.6 violation.
Can you confirm ? Or is there something that I'm missing ?
typedef struct
{
int a;
int b;
}s_ab;
int32* fct(s_ab* alpha)
{
return &(alpha->b);
}
s_ab* ab;
main
{
int* adr_b;
adr_b = fct(ab);
}
Compilation will lead to
(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 ("alpha")
return &(alpha->b);
Thank you,
Clement