[PATCH 1/8] perf symbols: Make variable receiving result strrchr() const

Arnaldo Carvalho de Melo
2026-04-08T17:29:05Z

Fixing:

util/symbol.c: In function ‘symbol__config_symfs’:
util/symbol.c:2499:20: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
2499 | layout_str = strrchr(dir, ',');
|

With recent gcc/glibc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/symbol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b4b30675688dbda5..708375d67b85fd1f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2492,7 +2492,7 @@ int symbol__config_symfs(const struct option *opt __maybe_unused,
const char *dir, int unset __maybe_unused)
{
char *bf = NULL;
- char *layout_str;
+ const char *layout_str;
char *dir_copy;
int ret;

--
2.53.0