v1-0001-Add-cast-from-pointer-to-void.patch
text/x-patch
Filename: v1-0001-Add-cast-from-pointer-to-void.patch
Type: text/x-patch
Part: 0
Message:
implicit casts from void*
Patch
Format: format-patch
Series: patch v1-0001
Subject: Add cast from pointer to void
| File | + | − |
|---|---|---|
| src/include/port/pg_crc32c.h | 1 | 1 |
From fa45ec41de5201906ca1d6be663eb06f9ded5de4 Mon Sep 17 00:00:00 2001
From: John Naylor <john.naylor@postgresql.org>
Date: Tue, 1 Jul 2025 09:54:05 +0700
Subject: [PATCH v1] Add cast from pointer to void
Commit e2809e3a101 added code to a header which assigns a pointer
to void to a pointer to unsigned char. This causes build errors for
extensions written in C++. Fix by adding an explicit cast.
Discussion: https://postgr.es/m/
Backpatch-through: 18
---
src/include/port/pg_crc32c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/port/pg_crc32c.h b/src/include/port/pg_crc32c.h
index 82313bb7fcf..ae008118ea8 100644
--- a/src/include/port/pg_crc32c.h
+++ b/src/include/port/pg_crc32c.h
@@ -72,7 +72,7 @@ pg_comp_crc32c_dispatch(pg_crc32c crc, const void *data, size_t len)
{
if (__builtin_constant_p(len) && len < 32)
{
- const unsigned char *p = data;
+ const unsigned char *p = (const unsigned char *) data;
/*
* For small constant inputs, inline the computation to avoid a
--
2.50.0