>From a8fccc67ddbb1dbce3473ce99fc1c4ba72565158 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 5 Nov 2024 21:11:20 +0100 Subject: [PATCH 14/23] memset_explicit tests: Verify N3322 functionality. * tests/test-memset_explicit.c (main): Add a zero-size test. --- ChangeLog | 5 +++++ tests/test-memset_explicit.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index d36d51ebb8..1c6facac48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-11-05 Bruno Haible + + memset_explicit tests: Verify N3322 functionality. + * tests/test-memset_explicit.c (main): Add a zero-size test. + 2024-11-05 Bruno Haible memset tests: Verify N3322 functionality. diff --git a/tests/test-memset_explicit.c b/tests/test-memset_explicit.c index 477415b45f..79f2aad570 100644 --- a/tests/test-memset_explicit.c +++ b/tests/test-memset_explicit.c @@ -243,5 +243,12 @@ main () test_heap (); test_stack (); + /* Test zero-length operations on NULL pointers, allowed by + . */ + { + int volatile value = (memset_explicit (NULL, '?', 0) == NULL); + ASSERT (value); + } + return test_exit_status; } -- 2.34.1