Re: Remove useless casts to (void *)

Поиск
Список
Период
Сортировка
От Jacob Champion
Тема Re: Remove useless casts to (void *)
Дата
Msg-id CAOYmi+mP7mVcmtvTMtWksHJyftVpXsNuqiyTf6eYx4EhMVg1nQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Remove useless casts to (void *)  (Aleksander Alekseev <aleksander@tigerdata.com>)
Список pgsql-hackers
On Thu, Nov 20, 2025 at 6:02 AM Aleksander Alekseev
<aleksander@tigerdata.com> wrote:
> Here `databuf` has a type (void*). Although the code is correct, it
> replaces an explicit cast (which I read "yes, we know what we are
> doing") with an implicit one.

"Yes, we know what we are doing" is the argument against doing it,
though. There's no upside to telling the compiler that in this case:
if it's correct, the compiler would have done it for you anyway, and
if it's buggy, now the compiler has been told to stay silent.

So +1 on removing unneeded (void *) casts in general, for the sake of
establishing consensus, though I haven't looked at this particular
patch in detail.

--Jacob



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