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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-01-29
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Here is another testcase but this time without using union too:
```
#define size 10

void strlcpy (char *, const char *, long)
    __attribute__ ((__access__ (__write_only__, 1, 3)));
struct s
{
  char a[size];
  char b[size];
};

void f(char *s, char *e);
struct s *sl;
char * g()
{
  char *e = &sl->a[size];
  strlcpy(&sl->b[0], "Hi", 10);
  return e;
}
```

g returns the end+1 of the array which is valid and well defined.

Reply via email to