Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-852

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • External
    • None
    • HP aCC 6.16

    • Compiler Warning

    Description

      The warning below is bogus:

      $ 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].)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebor Martin Sebor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: