01-03-2017, 11:31 AM
Code:
#define MAX_BUF_LEN 20
#define MAX_ID_LEN 40
typedef struct
{
uint8_t sno[MAX_BUF_LEN];
uint8_t ID[MAX_ID_LEN ];'
} xdata_t;
typedef {
uint8_t time;
uint32_t vol;
uint8_t ID[MAX_ID_LEN ];
}xpf_t
xdata_t testdata;
xpf_t pfdata
....
memcpy(pfdata.ID, testdata.ID, MAX_ID_LEN ); // Misra not compliant
......
I am using parasoft tool for checking misra compliance. for the above memcpy line I am getting the following misra non compliance
Values is "ID" passed to library function "memcpy" without being checked
I am using statically declared array. Why is it throwing this misra compliance? Can any one point how to make thsi line compliant
TIA
Narendra
<t></t>