![]() |
|
MISRA C:2012 Rule-19.1: (Mandatory) |
|
||||
![]() | |||||||
Exception:
The following are permitted because the behaviour is well-defined:
Example Code:
#include "string.h"
#include "misra.h"
#include "m3cmex.h"
extern int16_t rule_1901( void )
{
PC buf[100] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
(void)memcpy( &buf[ 10 ], &buf[ 20 ], 20U ); /* 2776 */
u16a = 5U;
(void)memcpy( &buf[ 10 ], &buf[ 20 ], u16a ); /* */
if (s16a > 0)
{
u16a = 30U;
}
(void)memcpy( &buf[ 10 ], &buf[ 20 ], u16a ); /* 2777 */
return 1;
}
QAC messages that encompass this guideline:
| 2776 | Definite: Copy between overlapping objects. |
| 2777 | Apparent: Copy between overlapping objects. |
|
||
(c) The Motor Industry Research Association, 2012
|
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0 © 2013 Programming Research www.programmingresearch.com |
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |