build: avoid three warnings when compiling against glibc-2.43

Functions like strchr() now return 'const char' instead of just 'char'.

This addresses the second part of https://savannah.gnu.org/bugs/?67954.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
This commit is contained in:
Benno Schulenberg
2026-01-28 17:18:10 +01:00
parent 5131dca77f
commit aca7face38
3 changed files with 4 additions and 4 deletions

View File

@@ -545,7 +545,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle,
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
/* This function is equivalent to strchr() for multibyte strings. */
char *mbstrchr(const char *string, const char *chr)
const char *mbstrchr(const char *string, const char *chr)
{
#ifdef ENABLE_UTF8
if (using_utf8) {

View File

@@ -233,7 +233,7 @@ char *mbstrcasestr(const char *haystack, const char *needle);
char *revstrstr(const char *haystack, const char *needle, const char *pointer);
char *mbrevstrcasestr(const char *haystack, const char *needle, const char *pointer);
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
char *mbstrchr(const char *string, const char *chr);
const char *mbstrchr(const char *string, const char *chr);
#endif
#ifndef NANO_TINY
char *mbstrpbrk(const char *string, const char *accept);

View File

@@ -349,7 +349,7 @@ void implant(const char *string)
int get_code_from_plantation(void)
{
if (*plants_pointer == '{') {
char *closing = strchr(plants_pointer + 1, '}');
const char *closing = strchr(plants_pointer + 1, '}');
if (!closing)
return MISSING_BRACE;
@@ -380,7 +380,7 @@ int get_code_from_plantation(void)
return PLANTED_A_COMMAND;
} else {
char *opening = strchr(plants_pointer, '{');
const char *opening = strchr(plants_pointer, '{');
unsigned char firstbyte = *plants_pointer;
int length;