]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove implicit cast from 'void *'
authorJohn Naylor <john.naylor@postgresql.org>
Wed, 2 Jul 2025 04:51:10 +0000 (11:51 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Wed, 2 Jul 2025 04:51:10 +0000 (11:51 +0700)
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.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CANWCAZaCq9AHBuhs%3DMx7Gg_0Af9oRU7iAqr0itJCtfmsWwVmnQ%40mail.gmail.com
Backpatch-through: 18

src/include/port/pg_crc32c.h

index 82313bb7fcfee82ad9500a65547de8d3a747e781..ae008118ea818a6f406fd746da19ab9430d589a8 100644 (file)
@@ -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