This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3a3f614653ef0470f4ca76ed3394f120dbbd06e8
Author: Marco Casaroli <[email protected]>
AuthorDate: Tue Oct 27 19:55:40 2026 +0100

    include/string.h: Also declare index() and rindex().
    
    glibc and the BSDs declare index() and rindex() in <string.h> too, and
    older programs call them with only <string.h> (screen's termcap.c).
    With NuttX they got an implicit declaration, which newer compilers
    reject.  Declare them in <string.h> as well, as strcasecmp() and
    strncasecmp() already are.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 include/string.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/string.h b/include/string.h
index 2738eb8cb44..6f82dce06f3 100644
--- a/include/string.h
+++ b/include/string.h
@@ -81,6 +81,8 @@ int        strncmp(FAR const char *, FAR const char *, 
size_t);
 
 int        strcasecmp(FAR const char *, FAR const char *);
 int        strncasecmp(FAR const char *, FAR const char *, size_t);
+FAR char  *index(FAR const char *s, int c);
+FAR char  *rindex(FAR const char *s, int c);
 
 /* The parentheses keep the function-like macros of <strings.h> out */
 

Reply via email to