]> Savannah Git Hosting - gnulib.git/commitdiff
di-set: port better to CHERI-64
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Nov 2023 07:04:35 +0000 (23:04 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Nov 2023 08:10:34 +0000 (00:10 -0800)
* lib/di-set.c: Include stdint.h.
(hashint): Make it uintptr_t, not size_t, since it’s for use
when converting to pointer and back again.  This suppresses
a false positive on CHERI-64.
* modules/di-set (Depends-on): Add stdint.

ChangeLog
lib/di-set.c
modules/di-set

index c83d73ca3d516a748e5c5fe48e68bf5b6a64d02a..aae72a19878cfb2768ca925bfc5f75c8f7b26034 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2023-11-10  Paul Eggert  <eggert@cs.ucla.edu>
 
+       di-set: port better to CHERI-64
+       * lib/di-set.c: Include stdint.h.
+       (hashint): Make it uintptr_t, not size_t, since it’s for use
+       when converting to pointer and back again.  This suppresses
+       a false positive on CHERI-64.
+       * modules/di-set (Depends-on): Add stdint.
+
        stdio: fix port to older macOS
        * lib/stdio.in.h: It’s pre macOS 13, not pre macOS 10.13.
        Problem reported by Sevan Janiyan in:
index 6705a148ab2c7ae4ffb0073e392f6783f416aee2..f84fc9d95844dc25dd411f5973d5036fb001ae08 100644 (file)
 #include "ino-map.h"
 
 #include <limits.h>
+#include <stdint.h>
 #include <stdlib.h>
 
 /* The hash package hashes "void *", but this package wants to hash
    integers.  Use integers that are as large as possible, but no
    larger than void *, so that they can be cast to void * and back
    without losing information.  */
-typedef size_t hashint;
+typedef uintptr_t hashint;
 #define HASHINT_MAX ((hashint) -1)
 
 /* Integers represent inode numbers.  Integers in the range
index ef151c45710655564fc0ed157246274285187f2f..2da14ad48deac3752faa17603e4e3269d38aac6c 100644 (file)
@@ -8,6 +8,7 @@ lib/di-set.h
 Depends-on:
 ino-map
 hash
+stdint
 
 configure.ac: