On Tue, May 29, 2018 at 3:21 PM, Martin Sebor <mse...@gmail.com> wrote:
> To make review and testing easier (thank you, Franz), attached
> is an updated patch rebased on top of today's trunk.
>
> (Note that the patch intentionally doesn't suppress the warning
> for the submitted test case without adding the nonstring attribute.)

I needed to adjust the testcase to avoid spurious failures with make-g++:
commit 09168180281d4cdd7454a2edd80f7d654a54c0ca
Author: Jason Merrill <ja...@redhat.com>
Date:   Mon Jun 18 22:00:20 2018 -0400

            * c-c++-common/attr-nonstring-8.c: Fix message for C++.

diff --git a/gcc/testsuite/c-c++-common/attr-nonstring-8.c b/gcc/testsuite/c-c++-common/attr-nonstring-8.c
index 15b68ed23a2..33b67a71e81 100644
--- a/gcc/testsuite/c-c++-common/attr-nonstring-8.c
+++ b/gcc/testsuite/c-c++-common/attr-nonstring-8.c
@@ -60,7 +60,7 @@ void test_strncat_nonstring_cst (char *d)
   T (strncat (nd3, ns3, 4));     /* { dg-warning "argument 2 declared attribute .nonstring. is smaller than the specified bound 4" } */
   /* { dg-warning "specified bound 4 exceeds destination size 3" "" { target *-*-* } .-1 } */
 
-  T (strncat (d, pns, sizeof pns));   /* { dg-warning "argument to .sizeof. in .strncat. call is the same expression as the source" } */
+  T (strncat (d, pns, sizeof pns));   /* { dg-warning {argument to .sizeof. in [^\n]+strncat[^\n]+ call is the same expression as the source} } */
 }
 
 

Reply via email to