[Bug middle-end/108036] [12/13/14/15 Regression] Spurious warning for zero-sized array parameters to a function

2024-11-10 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108036

--- Comment #13 from Sam James  ---
They're not completely distinct (some of the middle-end overflow warnings do
use builtin_object_size and friends), fwiw, as does UBSAN.

[Bug middle-end/108036] [12/13/14/15 Regression] Spurious warning for zero-sized array parameters to a function

2024-11-10 Thread uecker at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108036

--- Comment #12 from uecker at gcc dot gnu.org ---

UBSan and Wstringop-overflow have completely separate implementations (I wish
there was a more sysematic approach...).

[Bug middle-end/108036] [12/13/14/15 Regression] Spurious warning for zero-sized array parameters to a function

2024-11-10 Thread alx at kernel dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108036

Alejandro Colomar  changed:

   What|Removed |Added

 CC||uecker at gcc dot gnu.org

--- Comment #11 from Alejandro Colomar  ---
I've tested with the recent changes from Martin Uecker, to see if this was
fixed.  It still triggers.  Martin, this might be related to the problems you
mentioned having with the UB sanitizers, right?  I guess the UB sanitizer
triggers for similar reasons that trigger this diagnostic.


$ cat end.c 
void h(char *start, char end[0]);

#define size 100
void j(void)
{
char dst[size];
h(dst, dst+size);
}


$ /opt/local/gnu/gcc/countof18/bin/gcc -Wall -Wextra end.c 
end.c: In function ‘j’:
end.c:7:9: warning: ‘h’ accessing 1 byte in a region of size 0
[-Wstringop-overflow=]
7 | h(dst, dst+size);
  | ^~~~
end.c:7:9: note: referencing argument 2 of type ‘char[0]’
end.c:1:6: note: in a call to function ‘h’

[Bug middle-end/108036] [12/13/14/15 Regression] Spurious warning for zero-sized array parameters to a function

2024-07-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108036

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|11.5|12.5

--- Comment #10 from Richard Biener  ---
GCC 11 branch is being closed.