The analyzer detected meaningless code computing the distance between the elements of different arrays.
Consider the following example:
ptrdiff_t offset()
{
char path[9] = "test.txt";
char resources[9] = "resr.txt";
return path - resources;
}
Subtracting the addresses of the two arrays allocated on the stack is pointless and very likely to be an error.
To discuss all the suspicious operations involving pointers to arrays, it is convenient to divide pointers into two imaginary groups:
new or malloc().new or malloc or pointers that the analyzer has no information about.Based on this division, we get a table of operations on pointers to arrays evaluation of which makes no sense (Table 1).

Table 1 – Meaningless pointer operations.
This diagnostic is classified as:
|
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders:
Take
a chance!