Skip to contentSkip to conversation

copperplate: Address compiler warning in pvheapobj_validate

PATCH New Jan Kiszka 1 participant 1 message Aug 5, 2024

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 copperplate: Address compiler warning in pvheapobj_validate

From: Jan Kiszka <[email protected]>

Resolves

include/copperplate/heapobj.h:180:22: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘ssize_t {aka long int}’ may change the sign of the result [-Wsign-conversion]

---
 include/copperplate/heapobj.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/copperplate/heapobj.h +1 -1
index f8d14a3aa2..51a95cb968 100644
@@ -177,7 +177,7 @@ static inline
 size_t pvheapobj_validate(struct heapobj *hobj, void *ptr)
 {
 	ssize_t size = heapmem_check((struct heap_memory *)hobj->pool, ptr);
-	return size < 0 ? 0 : size;
+	return size < 0 ? 0 : (size_t)size;
 }
 
 static inline
Signature · 1 line
2.43.0