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

Alejandro Colomar <alx at kernel dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uecker at gcc dot gnu.org

--- Comment #11 from Alejandro Colomar <alx at kernel dot org> ---
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’

Reply via email to