In a very specific build setup (using meson+ninja and gcc only), on armv6l, I came across that build error:
[112/132] Compiling C object subprojects/libwifi-0.0.6/examples/parse_eapol.p/parse_eapol_parse_eapol.c.o
FAILED: subprojects/libwifi-0.0.6/examples/parse_eapol.p/parse_eapol_parse_eapol.c.o
cc -Isubprojects/libwifi-0.0.6/examples/parse_eapol.p -Isubprojects/libwifi-0.0.6/examples -I../subprojects/libwifi-0.0.6/examples -I../subprojects/libwifi-0.0.6/src -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -Wall -Werror -O3 -MD -MQ subprojects/libwifi-0.0.6/examples/parse_eapol.p/parse_eapol_parse_eapol.c.o -MF subprojects/libwifi-0.0.6/examples/parse_eapol.p/parse_eapol_parse_eapol.c.o.d -o subprojects/libwifi-0.0.6/examples/parse_eapol.p/parse_eapol_parse_eapol.c.o -c ../subprojects/libwifi-0.0.6/examples/parse_eapol/parse_eapol.c
../subprojects/libwifi-0.0.6/examples/parse_eapol/parse_eapol.c: In function ‘handle_pkt’:
../subprojects/libwifi-0.0.6/examples/parse_eapol/parse_eapol.c:41:56: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]
41 | printf("EAPOL: Key Info: Replay Counter: %lu\n", data.key_info.replay_counter);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int uint64_t {aka long long unsigned int}
| %llu
cc1: all warnings being treated as errors
[113/132] Compiling C object subprojects/libwifi-0.0.6/utils/test_misc.p/src_helpers.c.o
ninja: build stopped: subcommand failed.
This is easly fixed with that patch:
diff --git a/examples/parse_eapol/parse_eapol.c b/examples/parse_eapol/parse_eapol.c
index cf35a6f..f36685b 100644
--- a/examples/parse_eapol/parse_eapol.c
+++ b/examples/parse_eapol/parse_eapol.c
@@ -38,7 +38,7 @@ void handle_pkt(unsigned char *args, const struct pcap_pkthdr *header, const uns
printf("EAPOL: Descriptor: %d\n", data.descriptor);
printf("EAPOL: Key Info: Information: 0x%04x\n", data.key_info.information);
printf("EAPOL: Key Info: Key Length: %d\n", data.key_info.key_length);
- printf("EAPOL: Key Info: Replay Counter: %lu\n", data.key_info.replay_counter);
+ printf("EAPOL: Key Info: Replay Counter: %"PRIu64"\n", data.key_info.replay_counter);
printf("EAPOL: Key Info: Nonce: ");
for (size_t i = 0; i < sizeof(data.key_info.nonce); ++i) {
printf("%02x ", data.key_info.nonce[i]);
diff --git a/utils/src/test_parsing.c b/utils/src/test_parsing.c
index b9f9dbc..84a1bde 100644
--- a/utils/src/test_parsing.c
+++ b/utils/src/test_parsing.c
@@ -370,7 +370,7 @@ void parse_data_eapol(struct libwifi_frame frame, unsigned char *args, const str
printf("EAPOL: Descriptor: %d\n", data.descriptor);
printf("EAPOL: Key Info: Information: 0x%04x\n", data.key_info.information);
printf("EAPOL: Key Info: Key Length: %d\n", data.key_info.key_length);
- printf("EAPOL: Key Info: Replay Counter: %llu\n", data.key_info.replay_counter);
+ printf("EAPOL: Key Info: Replay Counter: %"PRIu64"\n", data.key_info.replay_counter);
printf("EAPOL: Key Info: Nonce: ");
for (size_t i = 0; i < sizeof(data.key_info.nonce); ++i) printf("%02x ", data.key_info.nonce[i]);
The second snippet avoids a warning