[Bug middle-end/123801] [13/14/15/16 Regression] Wstringop-overflow false positive since r12-4240
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 29 02:57:44 GMT 2026
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.
More information about the Gcc-bugs
mailing list