diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
commit | 88a3ea34080ad3087a8191fbf479543153175d59 (patch) | |
tree | 34eaec34d3588e09f9a77abba776266f124dc823 /gcc/testsuite/c-c++-common/Wstringop-truncation.c | |
parent | 25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff) | |
parent | e65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff) | |
download | gccgo.tar.gz |
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wstringop-truncation.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/Wstringop-truncation.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/testsuite/c-c++-common/Wstringop-truncation.c b/gcc/testsuite/c-c++-common/Wstringop-truncation.c index dc8c618976e..bd520915502 100644 --- a/gcc/testsuite/c-c++-common/Wstringop-truncation.c +++ b/gcc/testsuite/c-c++-common/Wstringop-truncation.c @@ -188,7 +188,7 @@ void test_strncpy_ptr (char *d, const char* s, const char *t, int i) CPY (d, CHOOSE (s, t), 2); CPY (d, CHOOSE ("", "123"), 1); /* { dg-warning ".strncpy\[^\n\r\]* output may be truncated copying 1 byte from a string of length 3" } */ - CPY (d, CHOOSE ("1", "123"), 1); /* { dg-warning ".strncpy\[^\n\r\]* output truncated copying 1 byte from a string of length 1" } */ + CPY (d, CHOOSE ("1", "123"), 1); /* { dg-warning ".strncpy\[^\n\r\]* output truncated before terminating nul copying 1 byte from a string of the same length" } */ CPY (d, CHOOSE ("12", "123"), 1); /* { dg-warning ".strncpy\[^\n\r\]* output truncated copying 1 byte from a string of length 2" } */ CPY (d, CHOOSE ("123", "12"), 1); /* { dg-warning ".strncpy\[^\n\r\]* output truncated copying 1 byte from a string of length 2" } */ @@ -331,7 +331,7 @@ void test_strncpy_array (Dest *pd, int i, const char* s) /* This might be better written using memcpy() but it's safe so it probably shouldn't be diagnosed. It currently triggers a warning because of bug 81704. */ - strncpy (dst7, "0123456", sizeof dst7); /* { dg-bogus "truncated" "bug 81704" { xfail *-*-* } } */ + strncpy (dst7, "0123456", sizeof dst7); /* { dg-bogus "\\\[-Wstringop-truncation]" "bug 81704" { xfail *-*-* } } */ dst7[sizeof dst7 - 1] = '\0'; sink (dst7); } @@ -350,7 +350,7 @@ void test_strncpy_array (Dest *pd, int i, const char* s) } { - strncpy (pd->a5, "01234", sizeof pd->a5); /* { dg-bogus "truncated" "bug 81704" { xfail *-*-* } } */ + strncpy (pd->a5, "01234", sizeof pd->a5); /* { dg-bogus "\\\[-Wstringop-truncation]" "bug 81704" { xfail *-*-* } } */ pd->a5[sizeof pd->a5 - 1] = '\0'; sink (pd); } |