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

            Bug ID: 103111
           Summary: bogus stringop overflow warning
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: k.melekhin at gmail dot com
  Target Milestone: ---

Created attachment 51743
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51743&action=edit
test sample

Hello, please see the attachment.

Why is this warning being generated, it is clearly seen that there will only be
1 allocation and savepath->s_n is being set to 0. I know if I use unsigned
values warning goes away, but this warning still seems not right, because in
this case we are not even dealing with anything close to being considered
integer overflow.

I think this is a gcc bug, my appologies if this is known bug there seems to be
some similar open for c++ but not sure.

Reply via email to