Re: const qualifier for list APIs

2022-11-16 Thread Tom Lane
Ashutosh Bapat writes: > Functions like lappend_*() in list.c do not modify the second > argument. So it can be qualified as const. Any reason why we don't do > that? Is it because the target pointer ptr_value is not const > qualified? It would be a lie in many (most?) cases, wherever somebody

const qualifier for list APIs

2022-11-16 Thread Ashutosh Bapat
Hi All, Functions like lappend_*() in list.c do not modify the second argument. So it can be qualified as const. Any reason why we don't do that? Is it because the target pointer ptr_value is not const qualified? In my code, I am using lappend() and passing it the output of pq_getmsgstring()