[Bug c/102151] New: Spurious warning by -Warray-bounds when allocating with flexible array member

gniibe at fsij dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 1 01:42:54 GMT 2021


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

            Bug ID: 102151
           Summary: Spurious warning by -Warray-bounds when allocating
                    with flexible array member
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gniibe at fsij dot org
  Target Milestone: ---

Created attachment 51392
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51392&action=edit
Test with smaller size and valid access to the structure with flexible array
member

When allocating memory with smaller size than
sizeof(a_structure_with_flexible_member), for (valid) access to the structure,
compiler emits spurious warning, in some optimization level.


More information about the Gcc-bugs mailing list