Re: implicit casts from void*

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: implicit casts from void*
Дата
Msg-id 3145138.1751379847@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: implicit casts from void*  (John Naylor <johncnaylorls@gmail.com>)
Список pgsql-hackers
John Naylor <johncnaylorls@gmail.com> writes:
> On Tue, Jul 1, 2025 at 10:36 AM Tom Lane <tgl@sss.pgh.pa.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



В списке pgsql-hackers по дате отправления: