[PATCH 7/7] app/procinfo: fix const pointer in collectd format

David Marchand david.marchand at redhat.com
Fri Nov 28 14:56:15 CET 2025


With latest glibc (Fedora Rawhide):
../app/proc-info/main.c: In function 'collectd_resolve_cnt_type':
../app/proc-info/main.c:689:26: warning: initialization discards
	'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  689 |         char *type_end = strrchr(cnt_name, '_');
      |                          ^~~~~~~

Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id")
Cc: stable at dpdk.org

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 app/proc-info/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index b09c03ab35..5925bbb765 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -686,7 +686,7 @@ nic_stats_clear(uint16_t port_id)
 
 static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 				      const char *cnt_name) {
-	char *type_end = strrchr(cnt_name, '_');
+	const char *type_end = strrchr(cnt_name, '_');
 
 	if ((type_end != NULL) &&
 	    (strncmp(cnt_name, "rx_", strlen("rx_")) == 0)) {
-- 
2.51.1



More information about the dev mailing list