04-07-2018, 10:47 PM
Hello all,
I'm using the Misra 2004:C rules for the 1st time (e.g. I'm a newbie) and I got several errors linked to the rule M16.10 when I'm using the strncpy function like that:
I've fixed this error by adding a pointer to the code which is not used.
So my question is:
For the functions like strncpy, memset and others functions of the same style, do we need to fix the misra error or do we have to justify it plainly?
By advance, thanks for your help.
I'm using the Misra 2004:C rules for the 1st time (e.g. I'm a newbie) and I got several errors linked to the rule M16.10 when I'm using the strncpy function like that:
Code:
strncpy(MyStr1,MyConstStr, sizeof(MyConstStr);
I've fixed this error by adding a pointer to the code which is not used.
Code:
char *MyPtr;
MyPtr = strncpy(MyStr1,MyConstStr, sizeof(MyConstStr);
So my question is:
For the functions like strncpy, memset and others functions of the same style, do we need to fix the misra error or do we have to justify it plainly?
By advance, thanks for your help.
<t></t>