xiaoxiang781216 commented on code in PR #7468:
URL: https://github.com/apache/incubator-nuttx/pull/7468#discussion_r1008711036


##########
include/endian.h:
##########
@@ -52,36 +52,36 @@
 /* Common byte swapping macros */
 
 #ifdef CONFIG_HAVE_BUILTIN_BSWAP16
-#  define __swap_uint16 __builtin_bswap16
+#  define __swap_uint16(n) ((uint16_t)__builtin_bswap16(n))

Review Comment:
   Here, the return type of __builtin_bswap32 is 'unsigned int' not 'unsigned 
long'(uint32_t):
   ```
       Error: route/net_del_ramroute.c:94:9: error: format specifies type 
'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat]
               HTONL(match->target), HTONL(match->netmask));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       /github/workspace/sources/nuttx/include/debug.h:232:23: note: expanded 
from macro 'ninfo'
                             ^
       /github/workspace/sources/nuttx/include/debug.h:102:43: note: expanded 
from macro '_none'
           do { if (0) syslog(LOG_ERR, format, ##__VA_ARGS__); } while (0)
                                       ~~~~~~    ^~~~~~~~~~~
       /github/workspace/sources/nuttx/include/netinet/in.h:233:17: note: 
expanded from macro 'HTONL'
                       ^
       /github/workspace/sources/nuttx/include/endian.h:63:25: note: expanded 
from macro '__swap_uint32'
                               ^
       Error: route/net_del_ramroute.c:94:31: error: format specifies type 
'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat]
               HTONL(match->target), HTONL(match->netmask));
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
       /github/workspace/sources/nuttx/include/debug.h:232:23: note: expanded 
from macro 'ninfo'
                             ^
       /github/workspace/sources/nuttx/include/debug.h:102:43: note: expanded 
from macro '_none'
           do { if (0) syslog(LOG_ERR, format, ##__VA_ARGS__); } while (0)
                                       ~~~~~~    ^~~~~~~~~~~
       /github/workspace/sources/nuttx/include/netinet/in.h:233:17: note: 
expanded from macro 'HTONL'
                       ^
       /github/workspace/sources/nuttx/include/endian.h:63:25: note: expanded 
from macro '__swap_uint32'
   ```



-- 
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