From 60cae164b69ebf4ec4a65520c69aec994fb3160f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 11 May 2026 21:05:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20warning=20from=20strchr=20?= =?UTF-8?q?return=20value=20assignment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strchr in C is originally documented to return a char* value but this changed in ISO C23. Now the default is to use a type-generic function macro which returns the const-ness according to the parameter type. This is the default for gcc 16. This patch changes the local variable type and also removes the now unnecessary cast in the following expression. --- jsrc/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsrc/io.c b/jsrc/io.c index c2895a77a..075ed80ed 100644 --- a/jsrc/io.c +++ b/jsrc/io.c @@ -901,8 +901,8 @@ const char *sym_name = "JGetLocale"; Dl_info info; if (dladdr(sym_ptr,&info)){ // non-zero is success strcpy(path,info.dli_fname); - char *p1; - if((p1=strrchr(info.dli_fname,filesep))){path[p1-(char*)info.dli_fname]=0;} + const char *p1; + if((p1=strrchr(info.dli_fname,filesep))){path[p1-info.dli_fname]=0;} } else *path=0; } else *path=0; #endif