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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Summary|-Wfree-nonheap-object false |-Wfree-nonheap-object false
                   |positive with VLA parameter |positive with VLA parameter
                   |                            |that is a derefenced
   Last reconfirmed|                            |2024-02-19

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, reduced testcase:
```
const char **
add_string(int *restrict n, const char *strings[restrict *n])
{
  strings = __builtin_realloc(strings, *n);
  if (!strings)
    return 0;
  return strings;
}
```

Note if we had `int n` instead of a pointer, then there would be no warning.

Reply via email to