[ was: Re: [PATCH 3/4] enhance overflow and truncation detection in strncpy and strncat (PR 81117) ]

On 08/06/2017 10:07 PM, Martin Sebor wrote:

        * c-c++-common/Wstringop-truncation.c: Same.

+/* Verify warnings for VLAs.  */
+
+void test_strncpy_vla (unsigned n, const char* s)
+{
+  char vla[n];

Hi,

this patch requires effective target alloca for test-case c-c++-common/Wstringop-truncation.c.

Committed as obvious.

Thanks,
- Tom
Require alloca for c-c++-common/Wstringop-truncation.c

2017-11-14  Tom de Vries  <t...@codesourcery.com>

	* c-c++-common/Wstringop-truncation.c: Require effective target alloca.

---
 gcc/testsuite/c-c++-common/Wstringop-truncation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/Wstringop-truncation.c b/gcc/testsuite/c-c++-common/Wstringop-truncation.c
index c536a13..7fc439f 100644
--- a/gcc/testsuite/c-c++-common/Wstringop-truncation.c
+++ b/gcc/testsuite/c-c++-common/Wstringop-truncation.c
@@ -1,6 +1,7 @@
 /* PR middle-end/81117 - Improve buffer overflow checking in strncpy
    { dg-do compile }
-   { dg-options "-O2 -Wstringop-truncation -Wno-stringop-overflow -ftrack-macro-expansion=0" } */
+   { dg-options "-O2 -Wstringop-truncation -Wno-stringop-overflow -ftrack-macro-expansion=0" }
+   { dg-require-effective-target alloca } */
 
 
 typedef __SIZE_TYPE__ size_t;

Reply via email to