]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto-plugin.c: c23 compatibility: char * -> const char * master trunk
authorFilip Kastl <fkastl@suse.cz>
Mon, 22 Jun 2026 09:50:31 +0000 (11:50 +0200)
committerFilip Kastl <fkastl@suse.cz>
Mon, 22 Jun 2026 14:06:22 +0000 (16:06 +0200)
There are two uses of strrchr with const char * parameters in
lto-plugin.c where the result gets assigned to a non-const char *
variable.

Make the variable const char * so that we don't throw away const-ness.
I've seen clang produce warnings about this when compiling lto-plugin.c.

Regtested and bootstrapped on x86_64 linux.

lto-plugin/ChangeLog:

* lto-plugin.c (process_symtab): char *s -> const char *s.
(process_symtab_extension): Ditto.

Signed-off-by: Filip Kastl <fkastl@suse.cz>
lto-plugin/lto-plugin.c

index 8cd707087e7202253983bb8ac6984ec6928c1383..778c3d21165a36b02b77a43526c7ca93aa987bc2 100644 (file)
@@ -1091,7 +1091,7 @@ static int
 process_symtab (void *data, const char *name, off_t offset, off_t length)
 {
   struct plugin_objfile *obj = (struct plugin_objfile *)data;
-  char *s;
+  const char *s;
   char *secdatastart, *secdata;
 
   if (!startswith (name, ".gnu.lto_.symtab"))
@@ -1143,7 +1143,7 @@ process_symtab_extension (void *data, const char *name, off_t offset,
                          off_t length)
 {
   struct plugin_objfile *obj = (struct plugin_objfile *)data;
-  char *s;
+  const char *s;
   char *secdatastart, *secdata;
 
   if (!startswith (name, ".gnu.lto_.ext_symtab"))