Re: Add explicit casts in four places to simplehash.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Geier <geidav(dot)pg(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add explicit casts in four places to simplehash.h
Date: 2022-11-03 14:50:18
Message-ID: 2063437.1667487018@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Geier <geidav(dot)pg(at)gmail(dot)com> writes:
> What about, while not being strictly necessary for PostgreSQL itself,
> also adding such casts to simplehash.h so that it can be used in code
> where -Wc++-compat is enabled?

Seems reasonable, so done (I fixed one additional spot you missed).

The bigger picture here is that we do actually endeavor to keep
(most of) our headers C++ clean, but our tool cpluspluscheck misses
these problems because it doesn't try to use these macros.
I wonder whether there is a way to do better.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2022-11-03 15:20:47 Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment
Previous Message Nikita Malakhov 2022-11-03 14:30:02 Re: Pluggable toaster