https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523

            Bug ID: 105523
           Summary: Wrong warning array subscript [0] is outside array
                    bounds
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: klaus.doldinger64 at googlemail dot com
  Target Milestone: ---

The following code produces the above mentined wrong warning:

----

#include <stdint.h>

int main() {
    const auto ptr2 = reinterpret_cast<volatile uint8_t*>(0x0030);
    *ptr2 = 0xd8;
}

----

Up to avr-g++-11.3.1 there was no warning in above code.

Reply via email to