PR c/85931 - -Wsizeof-pointer-memaccess for strncpy with size of source
authorMartin Sebor <msebor@redhat.com>
Tue, 12 Jun 2018 17:14:31 +0000 (17:14 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 12 Jun 2018 17:14:31 +0000 (11:14 -0600)
commitbb0f14ae684a38a44aaf42b312c213aedaa74103
tree7e041b94bbe264ea9855d679e7299cd8a1f4281d
parent132afeecc3f5adc88a029f9d1e11ca6d64ab3e8b
PR c/85931 -  -Wsizeof-pointer-memaccess for strncpy with size of source

gcc/c-family/ChangeLog:

PR c/85931
* c-warn.c (sizeof_pointer_memaccess_warning): Avoid warning when
sizeof source and destination yields the same value.

gcc/ChangeLog:

PR c/85931
* fold-const.c (operand_equal_p): Handle SAVE_EXPR.

gcc/testsuite/ChangeLog:

PR c/85931
* gcc.dg/Wstringop-truncation-3.c: New test.

From-SVN: r261515
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-warn.c
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-truncation-3.c [new file with mode: 0644]