]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix another case of indirectly casting away const.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Jun 2026 15:37:43 +0000 (11:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 4 Jun 2026 15:37:55 +0000 (11:37 -0400)
commitc35f85ac02a1c19dbb40382a8098846ffc3b368b
tree7be7623b92a35fb3395153aa70358ff65e6799f5
parent4dce650cc1bb48d6a65503f17dff87085728e08b
Fix another case of indirectly casting away const.

Like 8f1791c61, this fixes a case of implicitly casting away
const by not treating the result of strrchr() on a const pointer
as const.  This was missed at the time because the machines
reporting those warnings weren't building with --with-llvm.

While here, clean up another infelicity: in the probably-
impossible case that the input string contains only one dot,
this function would call pnstrdup() with a length of -1
and thereby emit a module name equal to the function name.
It seems to me we should emit modname = NULL instead.

Also remove a useless Assert and two redundant assignments.

Back-patch, as 8f1791c61 was, so that users of back branches
don't see this warning when building with late-model gcc.

Reported-by: hubert depesz lubaczewski <depesz@depesz.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/aiGNJ89PBqvq2Yyz@depesz.com
Backpatch-through: 14
src/backend/jit/llvm/llvmjit.c