![]() |
![]() |
2771 | ![]() |
||||
![]() | |||||||
| Pointers | |||||||
A definite condition has been detected. An operation is being performed to compare or subtract the value of two pointers which address different objects. Behavior is undefined if an attempt is made to subtract pointers which do not address elements of the same array or to compare (with a relational operator) pointers which do not point to the same struct, union or array. For example:
/*PRQA S 488,490,2017,2983,2991,2995,3132,3203,3355,3358,3408,3447 ++*/
extern int buf1[10];
extern int buf2[10];
extern void f2771(void)
{
int * p1;
int * p2;
long d;
p1 = buf1;
p2 = buf2;
d = p2 - p1; /* 2771 */
if (p2 > p1) /* 2771 */
{
}
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |