[Bug c/57627] -Wsizeof-pointer-memaccess should make an exception for character types

harald at gigawatt dot nl gcc-bugzilla@gcc.gnu.org
Wed Jun 26 16:43:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57627

--- Comment #1 from Harald van Dijk <harald at gigawatt dot nl> ---
I just realised the very similar example

void f4(char *dst, char *src)
{ __builtin_memcpy(dst, src, sizeof(src)); }

void f5(unsigned char *dst, unsigned char *src)
{ __builtin_memcpy(dst, src, sizeof(src)); }

also gets a warning, but in that case, I fully agree with the warning GCC
currently gives. So, to clarify, my request/suggestion is *only* to suppress
the warning for f2 and f3 in my report, and leave the behaviour for these f4
and f5 as it is.



More information about the Gcc-bugs mailing list