To be compilable both on 32 and 64 bit architectures the PRIu64 macro
needs to be used as format specifier for uint64_t. Otherwise we'll get
the following type of error either on 32 bit (for %lx) or 64 bit (for
%llx) :
monitor/l2cap.c: In function 'sig_info_rsp':
monitor/l2cap.c:351:3: error: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'uint64_t' [-Werror=format]
#include <config.h>
#endif
+#include <inttypes.h>
+
#include <bluetooth/bluetooth.h>
#include "bt.h"
break;
}
channels = bt_get_le64(data);
- print_field("Channels: 0x%16.16lx", channels);
+ print_field("Channels: 0x%16.16" PRIu64, channels);
break;
default:
packet_hexdump(data, size);