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


##########
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:
   According to https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html 
`__builtin_bswap32` has the next prototype: `uint32_t __builtin_bswap32 
(uint32_t x)`, so it is exactly `uint32_t` and not `unsigned int` or `unsigned 
long`. Maybe the correct way is to fix format message from
   ```
     ninfo("  target=%08lx netmask=%08lx\n",
           HTONL(match->target), HTONL(match->netmask));
   ```
   to
   ```
     ninfo("  target=%08" PRIx32 " netmask=%08" PRIx32 "\n",
           HTONL(match->target), HTONL(match->netmask));
   ```
   ?



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