[riot-notifications] [RIOT-OS/RIOT] gnrc_sixlowpan: don't use PRIx8 (#11124)

Marian Buschsieweke notifications at github.com
Thu Mar 7 20:46:30 CET 2019


maribu commented on this pull request.



> @@ -222,8 +217,7 @@ static void _receive(gnrc_pktsnip_t *pkt)
     }
 #endif
     else {
-        DEBUG("6lo: dispatch %02" PRIx8 " ... is not supported\n",
-              dispatch[0]);
+        DEBUG("6lo: dispatch %02x... is not supported\n", dispatch[0]);

I'm aware that in practice `float` gets promoted to `double` and all integer types smaller than `int` get promoted to `int`. But are you sure that is C standard? (At least ┬┤clang -Weverything` does not complain, so it might very well be.) If not, an `uint8_t` will be pushed on the argument stack and an `unsigned int` will be popped by `printf`.

I personally would do the cast even if this is officially specified, as it just looks strange if format specifier and argument are of different type

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11124#discussion_r263539334
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190307/7a0f0802/attachment.html>


More information about the notifications mailing list