Re: Mark function arguments of type "T *" as "const T *" where possible
| От | Jacob Champion |
|---|---|
| Тема | Re: Mark function arguments of type "T *" as "const T *" where possible |
| Дата | |
| Msg-id | CAOYmi+=O2XCda6-gdSdWv=zaDdA5vWFfE+ySk_tCF5Qx2P_A4g@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Mark function arguments of type "T *" as "const T *" where possible (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>) |
| Ответы |
Re: Mark function arguments of type "T *" as "const T *" where possible
|
| Список | pgsql-hackers |
On Wed, Dec 10, 2025 at 9:44 AM Bertrand Drouvot <bertranddrouvot.pg@gmail.com> wrote: > Thoughts? Kneejerk reaction (as someone who wants better const-correctness!): I suspect that this patch is not practically reviewable for most people. Especially knowing that the patchset was formed via subtraction of known-bad cases rather than addition of known-good cases. `const` needs to be added with intent. IMO this is especially problematic with our "context bag" structs. As one example: > static int > -InitializeLDAPConnection(Port *port, LDAP **ldap) > +InitializeLDAPConnection(const Port *port, LDAP **ldap) I don't see a good reason to constrain future developers in this way. Why shouldn't the code that makes LDAP connections be allowed to take notes inside the Port at some point in the future? --Jacob
В списке pgsql-hackers по дате отправления: