[HP aCC 6.16] bogus warning #20206-D: Out of bound access on a loop
-------------------------------------------------------------------

                 Key: STDCXX-852
                 URL: https://issues.apache.org/jira/browse/STDCXX-852
             Project: C++ Standard Library
          Issue Type: Bug
          Components: External
         Environment: HP aCC 6.16
            Reporter: Martin Sebor


The warning below is bogus:

{noformat}
$ cat t.cpp && aCC -c +O +w t.cpp 
int foo ()
{
    int a1 [] = { 2, 1, 0 };
    int a2 [] = { 0, 1, 2 };

    bool b = true;
    int i;
    for (i = 0; i != 3; ++i) {
        b = a1 [i] == a2 [i];
        if (!b) break;
    }

    if (!b) return a1 [i];
    return 0;
}
"t.cpp", line 13, procedure foo: warning #20206-D: Out of bound access (In
          expression "&a1[i]", array "a1" [t.cpp:3] (type: int [3]) has
          element range [0 .. 2], reading element range [0 .. 3].)
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to