You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/02 14:28:07 UTC

[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4043: select: fix asan report error

gustavonihei commented on a change in pull request #4043:
URL: https://github.com/apache/incubator-nuttx/pull/4043#discussion_r663054436



##########
File path: include/sys/select.h
##########
@@ -71,11 +71,11 @@
 /* Standard helper macros */
 
 #define FD_CLR(fd,set) \
-  ((((fd_set*)(set))->arr)[_FD_NDX(fd)] &= ~(1 << _FD_BIT(fd)))
+  ((((fd_set*)(set))->arr)[_FD_NDX(fd)] &= ~(1ul << _FD_BIT(fd)))

Review comment:
       ```suggestion
     ((((fd_set*)(set))->arr)[_FD_NDX(fd)] &= ~(UINT32_C(1) << _FD_BIT(fd)))
   ```
   The suffix for the integer type is architecture-dependent.
   Since this is a common header, it is recommended to use the macros from `inttypes.h` for applying the proper suffix:




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org