Hi,

On Wed, Dec 10, 2025 at 12:22:22PM -0800, Jacob Champion wrote:
> On Wed, Dec 10, 2025 at 9:44 AM Bertrand Drouvot
> <[email protected]> wrote:
> > Thoughts?
> 
> Kneejerk reaction (as someone who wants better const-correctness!):

Thanks for sharing your thoughts!

> 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.

That's fair feedback. The automated approach was meant to catch all of them
but you're right that it sacrifices intentionality.
Also, with the patch in place that would mean "think twice before changing
from const to no const" and that could create doubts and waste of time for 
future
patch authors.

> 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?

Yeah, that's a good point. Let me try to focus on functions that really 
deserve the change. I could look at function names that contain "copy" or "cmp",
functions that are used for formatting/printing and size/length calculations as
examples.
Any other ideas?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com


Reply via email to