Re: [HACKERS] Add some const decorations to prototypes

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: [HACKERS] Add some const decorations to prototypes
Дата
Msg-id alpine.DEB.2.20.1711042145320.14090@lancre
обсуждение исходный текст
Ответ на Re: [HACKERS] Add some const decorations to prototypes  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] Add some const decorations to prototypes
Список pgsql-hackers
>> Just leave it as char*.  If you change the endptr argument you're going to
>> force every call site to change their return variable, and some of them
>> would end up having to cast away the const on their end.
>
> OK, here is an updated patch with the controversial bits removed.

I'm in general favor in helping compilers, but if you have to cheat.

ISTM That there is still at least one strange cast:
 +static const char **LWLockTrancheArray = NULL; +               LWLockTrancheArray = (const char **) // twice

Maybe some function should return a "const char **", or the const is not 
really justified?

-- 
Fabien.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: [HACKERS] Display number of heap accesses for index scans
Следующее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: [HACKERS] Support to COMMENT ON DATABASE CURRENT_DATABASE