Re: Mark function arguments of type "Datum *" as "const Datum *" where possible

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
Дата
Msg-id aNZ98hfppZk54ml1@paquier.xyz
обсуждение исходный текст
Ответ на Re: Mark function arguments of type "Datum *" as "const Datum *" where possible  (Chao Li <li.evan.chao@gmail.com>)
Ответы Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
Список pgsql-hackers
On Fri, Sep 26, 2025 at 03:35:54PM +0800, Chao Li wrote:
>> I noticed that many functions take "Datum *" parameters while they don't
>> update the data. So I created this patch to change "Datum *" to "const
>> Datum *" wherever possible, which should improve type safety and make the
>> interfaces clearer about their intent, also helps the compiler catch
>> accidental modifications.

I have not looked at the patch in details and we need a careful
case-by-case review, but being more protective with the Datums that
travel across the stack may be a good idea in the long-term depending
on the code path dealt with, so I like the initiative you are taking
here.
--
Michael

Вложения

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