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

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


The following commit(s) were added to refs/heads/master by this push:
     new fe34a3ee78e include/string.h: Also declare strcasecmp() and 
strncasecmp().
fe34a3ee78e is described below

commit fe34a3ee78eeaa62e9b4831f5d27a8dbf7d7ed3f
Author: Marco Casaroli <[email protected]>
AuthorDate: Thu Oct 8 22:02:16 2026 +0200

    include/string.h: Also declare strcasecmp() and strncasecmp().
    
    POSIX declares strcasecmp() and strncasecmp() in <strings.h>.  glibc,
    musl and newlib also declare them in <string.h>, and some programs
    rely on that: they include only <string.h> and get an implicit
    declaration on NuttX.
    
    Declare the two functions in <string.h> too.  Only the prototypes are
    added: the BSD macros of <strings.h> (bcopy(), bzero() and others) stay
    out of <string.h>.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 include/string.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/string.h b/include/string.h
index f000a87e1c7..8492d1fd393 100644
--- a/include/string.h
+++ b/include/string.h
@@ -74,6 +74,14 @@ size_t     strlcat(FAR char *, FAR const char *, size_t);
 FAR char  *strncat(FAR char *, FAR const char *, size_t);
 int        strcmp(FAR const char *, FAR const char *);
 int        strncmp(FAR const char *, FAR const char *, size_t);
+
+/* Also declared in <strings.h>.  Other C libraries declare them in
+ * <string.h> as well, and some programs rely on that.
+ */
+
+int        strcasecmp(FAR const char *, FAR const char *);
+int        strncasecmp(FAR const char *, FAR const char *, size_t);
+
 int        strcoll(FAR const char *, FAR const char *s2);
 FAR char  *strcpy(FAR char *dest, FAR const char *src);
 FAR char  *stpcpy(FAR char *dest, FAR const char *src);

Reply via email to