Re: implicit casts from void*

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: implicit casts from void*
Date: 2025-07-01 14:24:07
Message-ID: 3145138.1751379847@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

John Naylor <johncnaylorls(at)gmail(dot)com> writes:
> On Tue, Jul 1, 2025 at 10:36 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Hmpfh. No objection to your patch, but I wonder why
>> "headerscheck --cplusplus" didn't find this? Can we get it
>> to do so?

> Good question, and it turns out it catches it just fine, but you have
> to configure with CPPFLAGS="-msse4.2" (or run the script on a Red Hat
> 9-ish system).

Ha, indeed you are right. On my RHEL9 box, it's kinda drowned out
by complaints about

/usr/include/c++/11/bits/range_access.h:109:3: error: template with C linkage
109 | template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
| ^~~~~~~~
/tmp/headerscheck.u5CrRM/test.cpp:1:1: note: ‘extern "C"’ linkage started here
1 | extern "C" {
| ^~~~~~~~~~

but looking closer, I do see some

./src/include/port/pg_crc32c.h: In function ‘pg_crc32c pg_comp_crc32c_dispatch(pg_crc32c, const void*, size_t)’:
./src/include/port/pg_crc32c.h:75:42: error: invalid conversion from ‘const void*’ to ‘const unsigned char*’ [-fpermissive]
75 | const unsigned char *p = data;
| ^~~~
| |
| const void*

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-07-01 14:24:40 Re: No error checking when reading from file using zstd in pg_dump
Previous Message Andres Freund 2025-07-01 14:06:55 Re: Optimize LWLock scalability via ReadBiasedLWLock for heavily-shared locks