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

2018-05-25 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57627

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-05-25
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Martin Sebor  ---
I think I agree that it's less likely that sizeof (char) or even 1 is intended
in f2() than sizeof (char *).  Confirmed.

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

2013-06-26 Thread harald at gigawatt dot nl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57627

--- Comment #1 from Harald van Dijk  ---
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.