From 4274910c19724a20e101637f2c5bc97462ee3804 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 11 Nov 2024 10:59:16 -0800 Subject: [PATCH] malloca: pacify CHERI clang MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/malloca.c (freea) [__CHERI_PURE_CAPABILITY__]: Add a cast as the code otherwise doesn’t conform to C. --- ChangeLog | 6 ++++++ lib/malloca.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e5a49076b1..d5f294cd90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-11-11 Paul Eggert + + malloca: pacify CHERI clang + * lib/malloca.c (freea) [__CHERI_PURE_CAPABILITY__]: + Add a cast as the code otherwise doesn’t conform to C. + 2024-11-11 Bruno Haible acl-permissions: Define the inline functions in this module. diff --git a/lib/malloca.c b/lib/malloca.c index e75c72df84..b89437fd9b 100644 --- a/lib/malloca.c +++ b/lib/malloca.c @@ -118,7 +118,7 @@ freea (void *p) char *cp = p; small_t *sp = p; # if defined __CHERI_PURE_CAPABILITY__ - void *mem = sp[-1]; + void *mem = (void *) sp[-1]; # else void *mem = cp - sp[-1]; # endif -- 2.39.5