[PATCH]: fix x86_64 compile warnings in eap_wsc.c
Kel Modderman
kel
Wed Dec 26 06:09:54 PST 2007
The following compilation warnings can be observed on x86_64 when
CONFIG_EAP_WSC=y is set:
cc -MMD -O2 -Wall -g -I. -I../src -I../src/crypto -I../src/utils -I../src/common -I../src/rsn_supp -I../src/drivers/driver_madwifi/ -DCONFIG_BACKEND_FILE -DCONFIG_DRIVER_HOSTAP -DCONFIG_DRIVER_WEXT -DCONFIG_DRIVER_MADWIFI -DCONFIG_DRIVER_ATMEL -DCONFIG_DRIVER_WIRED -DCONFIG_DRIVER_TEST -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP -DEAP_SIM -DEAP_LEAP -DEAP_PSK -DEAP_AKA -DEAP_TLV -DEAP_PAX -DEAP_WSC -DIEEE8021X_EAPOL -DPCSC_FUNCS -I/usr/include/PCSC -DEAP_TLS_FUNCS -DEAP_TLS_OPENSSL -DPKCS12_FUNCS -DCONFIG_SMARTCARD -DINTERNAL_SHA256 -DCONFIG_WIRELESS_EXTENSION -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_VERSION_MAJOR=1 -DDBUS_VERSION_MINOR=1 -DCONFIG_READLINE -DCONFIG_PEERKEY -DCONFIG_IEEE80211W -DCONFIG_IEEE80211R -DCONFIG_NO_T_PRF -DCONFIG_DEBUG_FILE -c -o ../src/eap_peer/eap_wsc.o ../src/eap_peer/eap_wsc.c
../src/eap_peer/eap_wsc.c: In function 'eap_wsc_build_msg':
../src/eap_peer/eap_wsc.c:261: warning: format '%u' expects type 'unsigned
int', but argument 3 has type 'size_t'
../src/eap_peer/eap_wsc.c:275: warning: format '%u' expects type 'unsigned
int', but argument 3 has type 'size_t'
../src/eap_peer/eap_wsc.c:275: warning: format '%u' expects type 'unsigned
int', but argument 4 has type 'size_t'
../src/eap_peer/eap_wsc.c: In function 'eap_wsc_process':
../src/eap_peer/eap_wsc.c:389: warning: format '%u' expects type 'unsigned
int', but argument 3 has type 'long int'
../src/eap_peer/eap_wsc.c:389: warning: format '%u' expects type 'unsigned
int', but argument 4 has type 'size_t'
../src/eap_peer/eap_wsc.c:416: warning: format '%u' expects type 'unsigned
int', but argument 3 has type 'size_t'
../src/eap_peer/eap_wsc.c:416: warning: format '%u' expects type 'unsigned
int', but argument 4 has type 'size_t'
The attached patch makes them go away.
Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -257,8 +257,9 @@
ret->decision = DECISION_FAIL;
if (data->out_used == data->out_len) {
- wpa_printf(MSG_DEBUG, "EAP-WSC: Sending out %u bytes "
- "(message sent completely)", send_len);
+ wpa_printf(MSG_DEBUG, "EAP-WSC: Sending out %lu bytes "
+ "(message sent completely)",
+ (unsigned long) send_len);
os_free(data->out_buf);
data->out_buf = NULL;
data->out_len = data->out_used = 0;
@@ -270,9 +271,9 @@
} else
eap_wsc_state(data, MSG);
} else {
- wpa_printf(MSG_DEBUG, "EAP-WSC: Sending out %u bytes "
- "(%u more to send)", send_len,
- data->out_len - data->out_used);
+ wpa_printf(MSG_DEBUG, "EAP-WSC: Sending out %lu bytes "
+ "(%lu more to send)", (unsigned long) send_len,
+ (unsigned long) data->out_len - data->out_used);
eap_wsc_state(data, WAIT_FRAG_ACK);
}
@@ -385,8 +386,8 @@
os_memcpy(data->in_buf + data->in_used, pos, end - pos);
data->in_used += end - pos;
wpa_printf(MSG_DEBUG, "EAP-WSC: Received %u bytes, waiting "
- "for %u bytes more", end - pos,
- data->in_len - data->in_used);
+ "for %lu bytes more", (unsigned int) (end - pos),
+ (unsigned long) data->in_len - data->in_used);
}
if (flags & WSC_FLAGS_MF) {
@@ -410,10 +411,10 @@
data->in_used = end - pos;
data->in_op_code = op_code;
os_memcpy(data->in_buf, pos, data->in_used);
- wpa_printf(MSG_DEBUG, "EAP-WSC: Received %u bytes in "
- "first fragment, waiting for %u bytes more",
- data->in_used,
- data->in_len - data->in_used);
+ wpa_printf(MSG_DEBUG, "EAP-WSC: Received %lu bytes in "
+ "first fragment, waiting for %lu bytes more",
+ (unsigned long) data->in_used,
+ (unsigned long) data->in_len - data->in_used);
}
return eap_wsc_build_frag_ack(id, EAP_CODE_RESPONSE);
---
More information about the Hostap
mailing list