From 8bf0a7b3cde10faf40316e498949f5a16cb06e11 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 24 Oct 2023 18:33:44 -0700 Subject: [PATCH] explicit_bzero-tests: pacify GCC 13.2.1 * 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 de61a5fa0b..f5c3a1bdce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-10-24 Paul Eggert + + 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 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.39.5