bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] explicit_bzero-tests: pacify GCC 13.2.1


From: Paul Eggert
Subject: [PATCH 1/3] explicit_bzero-tests: pacify GCC 13.2.1
Date: Tue, 24 Oct 2023 18:40:46 -0700

* tests/test-explicit_bzero.c:
* tests/test-memset_explicit.c:
Ignore -Wdangling pointer.
---
 ChangeLog                    | 7 +++++++
 tests/test-explicit_bzero.c  | 5 +++++
 tests/test-memset_explicit.c | 5 +++++
 3 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index d5f78aeccf..8b846a1ca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-10-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       explicit_bzero-tests: pacify GCC 13.2.1
+       * tests/test-explicit_bzero.c:
+       * tests/test-memset_explicit.c:
+       Ignore -Wdangling pointer.
+
 2023-10-22  Bruno Haible  <bruno@clisp.org>
 
        memset_explicit, explicit_bzero tests: Fix test failures with new gcc.
diff --git a/tests/test-explicit_bzero.c b/tests/test-explicit_bzero.c
index f29f0ea0da..c4e4ddde77 100644
--- a/tests/test-explicit_bzero.c
+++ b/tests/test-explicit_bzero.c
@@ -41,6 +41,11 @@ static char zero[SECRET_SIZE] = { 0 };
 # define explicit_bzero(a, n)  memset (a, '\0', n)
 #endif
 
+/* Suppress GCC 13.2.1 false alarm, as this test needs a dangling pointer.  */
+#if 12 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wdangling-pointer"
+#endif
+
 /* =================== Verify operation on static memory =================== */
 
 static char stbuf[SECRET_SIZE];
diff --git a/tests/test-memset_explicit.c b/tests/test-memset_explicit.c
index cdc7fc30b2..5852caec02 100644
--- a/tests/test-memset_explicit.c
+++ b/tests/test-memset_explicit.c
@@ -43,6 +43,11 @@ static char zero[SECRET_SIZE] = { 0 };
 # define memset_explicit(a, c, n)  memset (a, c, n)
 #endif
 
+/* Suppress GCC 13.2.1 false alarm, as this test needs a dangling pointer.  */
+#if 12 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wdangling-pointer"
+#endif
+
 /* =================== Verify operation on static memory =================== */
 
 static char stbuf[SECRET_SIZE];
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]