[pseudo][PATCH v2 13/23] pseudo_util.c: strchr now returns const char

Mark Hatle <[email protected]> Fri, 3 Jul 2026 13:40:45 -0500
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <1783104055-19005-14-git-send-email-mark.hatle@kernel.crashing.org>
Fix compile warning:
  pseudo_util.c: In function ‘pseudo_append_elements’:
  pseudo_util.c:896:30: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    896 |                 char *next = strchr(path, '/');
        |                              ^~~~~~
  pseudo_util.c:898:30: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    898 |                         next = strchr(path, '\0');
        |                              ^

Signed-off-by: Mark Hatle <[email protected]>
---
 pseudo_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_util.c b/pseudo_util.c
index 4c05394..3eaa9e6 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -893,7 +893,7 @@ pseudo_append_elements(char *newpath, char *root, size_t allocated, char **curre
 	while (path < (start + elen) && *path) {
 		size_t this_elen;
 		int leave_this = 0;
-		char *next = strchr(path, '/');
+		const char *next = strchr(path, '/');
 		if (!next) {
 			next = strchr(path, '\0');
 			leave_this = leave_last;
-- 
1.8.3.1