xiaoxiang781216 commented on a change in pull request #5519:
URL: https://github.com/apache/incubator-nuttx/pull/5519#discussion_r810115503



##########
File path: libs/libc/string/lib_memchr.c
##########
@@ -49,17 +49,14 @@ FAR void *memchr(FAR const void *s, int c, size_t n)
 {
   FAR const unsigned char *p = (FAR const unsigned char *)s;
 
-  if (s)

Review comment:
       All change in this patch fix the compiler warning when we remove 
-fno-builtin from Make.defs

##########
File path: libs/libc/string/lib_strchr.c
##########
@@ -48,19 +48,16 @@
 #undef strchr /* See mm/README.txt */
 FAR char *strchr(FAR const char *s, int c)
 {
-  if (s)

Review comment:
       To fix the compiler warning

##########
File path: libs/libc/string/lib_strndup.c
##########
@@ -53,24 +53,22 @@
 FAR char *strndup(FAR const char *s, size_t size)
 {
   FAR char *news = NULL;
-  if (s)

Review comment:
       Fix warning:
   ```
       string/lib_strndup.c: In function 'strndup':
       Error: string/lib_strndup.c:56:6: error: nonnull argument 's' compared 
to NULL [-Werror=nonnull-compare]
          if (s)
   ```

##########
File path: libs/libc/string/lib_strdup.c
##########
@@ -36,13 +36,11 @@
 FAR char *strdup(FAR const char *s)
 {
   FAR char *news = NULL;
-  if (s)

Review comment:
       Fix the warning:
   ```
       string/lib_strdup.c: In function 'strdup':
       Error: string/lib_strdup.c:39:6: error: nonnull argument 's' compared to 
NULL [-Werror=nonnull-compare]
          if (s)
             ^
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to