]> Savannah Git Hosting - gnulib.git/commitdiff
malloca: pacify CHERI clang
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Nov 2024 18:59:16 +0000 (10:59 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Nov 2024 18:59:40 +0000 (10:59 -0800)
* lib/malloca.c (freea) [__CHERI_PURE_CAPABILITY__]:
Add a cast as the code otherwise doesn’t conform to C.

ChangeLog
lib/malloca.c

index abeae1e6b6f7179520df4ad501e77ad128d040b9..05594a95818dc70d7c07396438de5350ed12efc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-11-11  Paul Eggert  <eggert@cs.ucla.edu>
 
+       malloca: pacify CHERI clang
+       * lib/malloca.c (freea) [__CHERI_PURE_CAPABILITY__]:
+       Add a cast as the code otherwise doesn’t conform to C.
+
        file-has-acl: another nofollow fix for FreeBSD
        * lib/file-has-acl.c (file_has_aclinfo): On FreeBSD, NetBSD >= 10,
        if we don’t follow symlinks the first time, also don’t follow
index 520f34d280afd4e842737e6b21d97f4cf8accd29..2219459490381dbe23fd7586d83e6fab2d30f5f2 100644 (file)
@@ -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