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.
Hi Folks,
MISRA warning (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
I note from past posts that there seems to be long running issues with this MISRA warning so I would like to add my test case:
typedef struct { uint16_t foo; uint16_t bar; } myStruct_t; typedef mystruct_t * myHandle_t; myStruct_t fbs = {0U}; myHandle_t fbh = &fbs; void myStructUpdater (myHandle_t h) { h->foo = h->bar; /* MISRA 17.6/R warning here. */ }
I think maybe this warning should not be here as an address is not being assigned and the assigned object has the same storage class as the object to which it is being assigned.
Thanks
Thank you for informing us about this issue. I can reproduce it. I filed SDSCM00051286 in the SDOWP system to have this investigated. Feel free to follow it with the SDOWP link below in my signature.
Toby Mole said:I am using C2000 v6.2.10. This is the latest version, right?
The latest version at this time is 6.4.1. I verified the problem exists in 6.4.1 as well.
Thanks and regards,
-George