Re: More const-marking cleanup

2025-12-05 Thread Tom Lane
I wrote: > Ah. Your script didn't notice the need for const'ification of > additional variables in map_locale() :-(. I fixed that and > pushed everything except the ecpg/preproc/variable.c changes, > which I'm not too comfortable about yet. (The code coverage > report shows that large chunks of

Re: More const-marking cleanup

2025-12-05 Thread Tom Lane
Bertrand Drouvot writes: > On Fri, Dec 05, 2025 at 09:47:56AM -0500, Tom Lane wrote: >> Cool, how'd you find these? > With the help of a coccinelle script. Will polish and share. Ah. Your script didn't notice the need for const'ification of additional variables in map_locale() :-(. I fixed tha

Re: More const-marking cleanup

2025-12-05 Thread Bertrand Drouvot
Hi, On Fri, Dec 05, 2025 at 09:47:56AM -0500, Tom Lane wrote: > Bertrand Drouvot writes: > > What about adding the 4 in the attached? > > Cool, how'd you find these? With the help of a coccinelle script. Will polish and share. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Ope

Re: More const-marking cleanup

2025-12-05 Thread Tom Lane
Bertrand Drouvot writes: > What about adding the 4 in the attached? Cool, how'd you find these? regards, tom lane

Re: More const-marking cleanup

2025-12-05 Thread Bertrand Drouvot
Hi, On Thu, Dec 04, 2025 at 05:09:30PM -0500, Tom Lane wrote: > Attached is a patch that cleans up all the cases I saw on a local > rawhide installation. What about adding the 4 in the attached? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Ser

Re: More const-marking cleanup

2025-12-04 Thread Thomas Munro
On Fri, Dec 5, 2025 at 11:09 AM Tom Lane wrote: > Apparently, latest gcc is able to notice that constructions like > > const char *str = ...; > char *ptr = strchr(str, ':'); > > are effectively casting away const. This is a good thing and long > overdue, but we have some wor

More const-marking cleanup

2025-12-04 Thread Tom Lane
I noticed that our two buildfarm animals that are running Fedora rawhide (caiman, midge) are emitting warnings like compression.c: In function "parse_compress_options": compression.c:458:13: warning: assignment discards "const" qualifier from pointer target type [-Wdiscarded-qualifiers] 458 |