Commit 863950d2 by Martin Sebor Committed by Martin Sebor

PR testsuite/92016 - Excess errors in Wstringop-overflow-17.c

gcc/testsuite/ChangeLog:
	* gcc.dg/Wstringop-overflow-17.c: Expect an additional warning.

From-SVN: r277008
parent 7e601a1d
2019-10-15 Martin Sebor <msebor@redhat.com>
PR testsuite/92016
* gcc.dg/Wstringop-overflow-17.c: Expect an additional warning.
2019-10-15 Bill Schmidt <wschmidt@linux.ibm.com> 2019-10-15 Bill Schmidt <wschmidt@linux.ibm.com>
PR target/92093 PR target/92093
......
/* Test to verify that -Wstringop-overflow mentions the referenced object /* Test to verify that -Wstringop-overflow mentions the referenced object
i.
{ dg-do compile } { dg-do compile }
{ dg-options "-O2 -Wall" } */ { dg-options "-O2 -Wall" } */
static void copy_n (char *d, const char *s, int n) static void copy_n (char *d, const char *s, int n)
{ {
while (n--) while (n--)
*d++ = *s++; *d++ = *s++; // { dg-warning "writing 1 byte into a region of size 0" }
*d = 0; // { dg-warning "writing 1 byte into a region of size 0" } *d = 0; // { dg-warning "writing 1 byte into a region of size 0" }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment