]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gprof: Fix strchr discarded qualifier call
authorMark Wielaard <mark@klomp.org>
Sat, 2 May 2026 16:56:51 +0000 (18:56 +0200)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 3 May 2026 21:47:56 +0000 (05:47 +0800)
In annotate_source strrchr is called on a const char *. So the result
should also be stored in a const char *.

* gprof/source.c (annotate_source): Make name_only a const char *.

gprof/source.c

index 860c0b5fec02518f9663fe22297336050dfbea42..4aa7504e8df3a63fc1af6a98e84d015b83b4e88c 100644 (file)
@@ -98,7 +98,8 @@ annotate_source (Source_File *sf, unsigned int max_width,
   bool new_line;
   char buf[8192];
   char *fname;
-  char *annotation, *name_only;
+  char *annotation;
+  const char *name_only;
   FILE *ifp, *ofp;
   Search_List_Elem *sle = src_search_list.head;