Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule M16.10
#2
From ISO C standard:

Quote:The strncpy function returns the value of s1.

So, no error information to test and hence no violation of 16.10.

If you upgrade to MISRA C 2012 you can use this explicit exception for function return values:

Code:
(void)strncpy(MyStr1,MyConstStr, sizeof(MyConstStr);

I did not find a corresponding entry in the obsolete 2004 standard.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)