https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80936
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-08-29 CC| |egallager at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> --- I get warnings for the bcopy parts: $ /usr/local/bin/gcc -c -O2 -S -Wall -Wextra 80936.c 80936.c: In function ‘zero0’: 80936.c:4:3: warning: argument 1 null where non-null expected [-Wnonnull] __builtin_memset (p, 0, n); // warning, good ^~~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:4:3: note: in a call to built-in function ‘__builtin_memset’ 80936.c: In function ‘copy0’: 80936.c:16:3: warning: argument 1 null where non-null expected [-Wnonnull] __builtin_memcpy (p, q, n); // warning, good ^~~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:16:3: note: in a call to built-in function ‘__builtin_memcpy’ 80936.c: In function ‘copy1’: 80936.c:22:3: warning: argument 2 null where non-null expected [-Wnonnull] __builtin_memcpy (p, q, n); // warning, good ^~~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:22:3: note: in a call to built-in function ‘__builtin_memcpy’ 80936.c: In function ‘copy2’: 80936.c:28:3: warning: argument 1 null where non-null expected [-Wnonnull] __builtin_bcopy (q, p, n); // missing warning ^~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:28:3: note: in a call to built-in function ‘__builtin_memmove’ 80936.c: In function ‘copy3’: 80936.c:34:3: warning: argument 2 null where non-null expected [-Wnonnull] __builtin_bcopy (q, p, n); // missing warning ^~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:34:3: note: in a call to built-in function ‘__builtin_memmove’ 80936.c: In function ‘cmp0’: 80936.c:40:10: warning: argument 1 null where non-null expected [-Wnonnull] return __builtin_memcmp (p, q, n); // warning, good ^~~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:40:10: note: in a call to built-in function ‘__builtin_memcmp’ 80936.c: In function ‘cmp1’: 80936.c:47:10: warning: argument 2 null where non-null expected [-Wnonnull] return __builtin_memcmp (p, q, n); // warning, good ^~~~~~~~~~~~~~~~~~~~~~~~~~ 80936.c:47:10: note: in a call to built-in function ‘__builtin_memcmp’ $ Confirmed for the rest though.