Remove use of rindex() function
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 8 Jan 2026 07:45:59 +0000 (08:45 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 8 Jan 2026 07:53:49 +0000 (08:53 +0100)
rindex() has been removed from POSIX 2008.  Replace the one remaining
use with the equivalent and more standard strrchr().

Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/98ce805c-6103-421b-adc3-fcf8f3dddbe3%40eisentraut.org

src/backend/jit/llvm/llvmjit.c

index 49e76153f9a1d542f93a6927c9f16fb09c48f19d..8d009dd5cf784576ca2108e0d671d5df81dafe5c 100644 (file)
@@ -1058,7 +1058,7 @@ llvm_split_symbol_name(const char *name, char **modname, char **funcname)
                 * Symbol names cannot contain a ., therefore we can split based on
                 * first and last occurrence of one.
                 */
-               *funcname = rindex(name, '.');
+               *funcname = strrchr(name, '.');
                (*funcname)++;                  /* jump over . */
 
                *modname = pnstrdup(name + strlen("pgextern."),