diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 10550e7fd8..04524d2176 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -112,5 +112,3 @@ if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION) esptool_py_flash_target_image(${phy_name}-flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}") esptool_py_flash_target_image(flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}") endif() - -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index ed5f038b2f..b75629bc9b 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -426,7 +427,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void) ESP_LOGE(TAG, "PHY data partition not found"); return NULL; } - ESP_LOGD(TAG, "loading PHY init data from partition at offset 0x%x", partition->address); + ESP_LOGD(TAG, "loading PHY init data from partition at offset 0x%" PRIx32 "", partition->address); size_t init_data_store_length = sizeof(phy_init_magic_pre) + sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post); uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length); @@ -593,9 +594,9 @@ static esp_err_t load_cal_data_from_nvs_handle(nvs_handle_t handle, return err; } uint32_t cal_format_version = phy_get_rf_cal_version() & (~BIT(16)); - ESP_LOGV(TAG, "phy_get_rf_cal_version: %d\n", cal_format_version); + ESP_LOGV(TAG, "phy_get_rf_cal_version: %" PRId32 "\n", cal_format_version); if (cal_data_version != cal_format_version) { - ESP_LOGD(TAG, "%s: expected calibration data format %d, found %d", + ESP_LOGD(TAG, "%s: expected calibration data format %" PRId32 ", found %" PRId32 "", __func__, cal_format_version, cal_data_version); return ESP_FAIL; } @@ -651,7 +652,7 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle, } uint32_t cal_format_version = phy_get_rf_cal_version() & (~BIT(16)); - ESP_LOGV(TAG, "phy_get_rf_cal_version: %d\n", cal_format_version); + ESP_LOGV(TAG, "phy_get_rf_cal_version: %" PRId32 "\n", cal_format_version); err = nvs_set_u32(handle, PHY_CAL_VERSION_KEY, cal_format_version); if (err != ESP_OK) { ESP_LOGE(TAG, "%s: store calibration version failed(0x%x)\n", __func__, err); diff --git a/components/esp_phy/test/CMakeLists.txt b/components/esp_phy/test/CMakeLists.txt index 001c9ac36e..69dc92a8b8 100644 --- a/components/esp_phy/test/CMakeLists.txt +++ b/components/esp_phy/test/CMakeLists.txt @@ -2,4 +2,3 @@ idf_component_register(SRC_DIRS . PRIV_INCLUDE_DIRS . ${CMAKE_CURRENT_BINARY_DIR} PRIV_REQUIRES cmock test_utils nvs_flash ulp esp_common esp_phy esp_wifi ) -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 1323d51e3f..50f59886bf 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -58,5 +58,4 @@ if(CONFIG_ESP32_WIFI_ENABLED) endforeach() endif() - target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") endif() diff --git a/components/esp_wifi/src/wifi_default.c b/components/esp_wifi/src/wifi_default.c index 45fedd5250..21ff28f0b9 100644 --- a/components/esp_wifi/src/wifi_default.c +++ b/components/esp_wifi/src/wifi_default.c @@ -10,6 +10,7 @@ #include "esp_private/wifi.h" #include "esp_wifi_netif.h" #include +#include // // Purpose of this module is to provide basic wifi initialization setup for @@ -34,7 +35,7 @@ static void wifi_start(void *esp_netif, esp_event_base_t base, int32_t event_id, uint8_t mac[6]; esp_err_t ret; - ESP_LOGD(TAG, "%s esp-netif:%p event-id%d", __func__, esp_netif, event_id); + ESP_LOGD(TAG, "%s esp-netif:%p event-id%" PRId32 "", __func__, esp_netif, event_id); wifi_netif_driver_t driver = esp_netif_get_io_driver(esp_netif); diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c index 219522f558..ba2feff645 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa2.c @@ -5,7 +5,7 @@ */ #include - +#include #include "esp_err.h" #include "utils/includes.h" @@ -199,7 +199,7 @@ void wpa2_task(void *pvParameters ) if(sm->wpa2_sig_cnt[e->sig]) { sm->wpa2_sig_cnt[e->sig]--; } else { - wpa_printf(MSG_ERROR, "wpa2_task: invalid sig cnt, sig=%d cnt=%d", e->sig, sm->wpa2_sig_cnt[e->sig]); + wpa_printf(MSG_ERROR, "wpa2_task: invalid sig cnt, sig=%" PRId32 " cnt=%d", e->sig, sm->wpa2_sig_cnt[e->sig]); } DATA_MUTEX_GIVE(); } @@ -230,7 +230,7 @@ void wpa2_task(void *pvParameters ) break; } else { if (s_wifi_wpa2_sync_sem) { - wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%d)", e->sig); + wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%" PRId32 ")", e->sig); os_semphr_give(s_wifi_wpa2_sync_sem); } else { wpa_printf(MSG_ERROR, "WPA2: null wifi->wpa2 sync sem"); @@ -243,7 +243,7 @@ void wpa2_task(void *pvParameters ) wpa_printf(MSG_DEBUG, "WPA2: task deleted"); s_wpa2_queue = NULL; if (s_wifi_wpa2_sync_sem) { - wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%d)", e->sig); + wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%" PRId32 ")", e->sig); os_semphr_give(s_wifi_wpa2_sync_sem); } else { wpa_printf(MSG_ERROR, "WPA2: null wifi->wpa2 sync sem"); @@ -385,10 +385,10 @@ int eap_sm_process_request(struct eap_sm *sm, struct wpabuf *reqData) } if (!eap_sm_allowMethod(sm, reqVendor, reqVendorMethod)) { - wpa_printf(MSG_DEBUG, "EAP: vendor %u method %u not allowed", + wpa_printf(MSG_DEBUG, "EAP: vendor %" PRIu32 " method %" PRIu32 " not allowed", reqVendor, reqVendorMethod); wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD - "vendor=%u method=%u -> NAK", + "vendor=%" PRIu32 " method=%" PRIu32 " -> NAK", reqVendor, reqVendorMethod); goto build_nak; } @@ -538,7 +538,7 @@ static int eap_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len, uint8_t *bss data_len = plen + sizeof(*hdr); #ifdef DEBUG_PRINT - wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%d\n", + wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%" PRId32 "", hdr->version, hdr->type, plen); #endif if (hdr->version < EAPOL_VERSION) { diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c index 62fc38e561..fd104e7266 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c @@ -10,6 +10,7 @@ #include "common/ieee802_11_defs.h" #include "esp_wifi_driver.h" #include "rsn_supp/wpa.h" +#include static struct sae_pt *g_sae_pt; static struct sae_data g_sae_data; @@ -246,7 +247,7 @@ static int wpa3_parse_sae_msg(u8 *buf, size_t len, u32 sae_msg_type, u16 status) esp_wpa3_free_sae_data(); break; default: - wpa_printf(MSG_ERROR, "wpa3: Invalid SAE msg type(%d)!", sae_msg_type); + wpa_printf(MSG_ERROR, "wpa3: Invalid SAE msg type(%" PRId32 ")!", sae_msg_type); ret = ESP_FAIL; break; } diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 3e4e13d6f5..8b502c9e4b 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -5,6 +5,7 @@ */ #include +#include #include "utils/includes.h" #include "common.h" @@ -147,12 +148,12 @@ void wps_task(void *pvParameters ) if (s_wps_sig_cnt[e->sig]) { s_wps_sig_cnt[e->sig]--; } else { - wpa_printf(MSG_ERROR, "wpsT: invalid sig cnt, sig=%d cnt=%d", e->sig, s_wps_sig_cnt[e->sig]); + wpa_printf(MSG_ERROR, "wpsT: invalid sig cnt, sig=%" PRId32 " cnt=%d", e->sig, s_wps_sig_cnt[e->sig]); } DATA_MUTEX_GIVE(); } - wpa_printf(MSG_DEBUG, "wpsT: rx sig=%d", e->sig); + wpa_printf(MSG_DEBUG, "wpsT: rx sig=%" PRId32 "", e->sig); switch (e->sig) { case SIG_WPS_ENABLE: @@ -160,7 +161,7 @@ void wps_task(void *pvParameters ) case SIG_WPS_START: param = (wps_ioctl_param_t *)e->par; if (!param) { - wpa_printf(MSG_ERROR, "wpsT: invalid param sig=%d", e->sig); + wpa_printf(MSG_ERROR, "wpsT: invalid param sig=%" PRId32 "", e->sig); os_semphr_give(s_wps_api_sem); break; } @@ -209,7 +210,7 @@ void wps_task(void *pvParameters ) break; default: - wpa_printf(MSG_ERROR, "wpsT: invalid sig=%d", e->sig); + wpa_printf(MSG_ERROR, "wpsT: invalid sig=%" PRId32 "", e->sig); break; } os_free(e); @@ -228,11 +229,11 @@ void wps_task(void *pvParameters ) */ int wps_post(uint32_t sig, uint32_t par) { - wpa_printf(MSG_DEBUG, "wps post: sig=%d cnt=%d", sig, s_wps_sig_cnt[sig]); + wpa_printf(MSG_DEBUG, "wps post: sig=%" PRId32 " cnt=%d", sig, s_wps_sig_cnt[sig]); DATA_MUTEX_TAKE(); if (s_wps_sig_cnt[sig]) { - wpa_printf(MSG_DEBUG, "wps post: sig=%d processing", sig); + wpa_printf(MSG_DEBUG, "wps post: sig=%" PRId32 " processing", sig); DATA_MUTEX_GIVE(); return ESP_OK; } else { @@ -866,13 +867,13 @@ int wps_start_msg_timer(void) if (sm->wps->state == WPS_FINISHED) { msg_timeout = 100; - wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %d ms", msg_timeout); + wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %" PRId32 " ms", msg_timeout); eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); eloop_register_timeout(0, msg_timeout*1000, wifi_station_wps_msg_timeout, NULL, NULL); ret = 0; } else if (sm->wps->state == RECV_M2) { msg_timeout = 5; - wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %d ms", msg_timeout); + wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %" PRId32 " ms", msg_timeout); eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL); eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL); ret = 0; @@ -963,7 +964,7 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len) eap_len = be_to_host16(ehdr->length); #ifdef DEBUG_PRINT - wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%d", + wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%" PRId32 "", hdr->version, hdr->type, plen); #endif @@ -1033,7 +1034,7 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len) eloop_register_timeout(3, 0, wifi_station_wps_eapol_start_handle, NULL, NULL); break; case EAP_TYPE_EXPANDED: - wpa_printf(MSG_DEBUG, "=========expanded plen[%d], %d===========", plen, sizeof(*ehdr)); + wpa_printf(MSG_DEBUG, "=========expanded plen[%" PRId32 "], %d===========", plen, sizeof(*ehdr)); if (ehdr->identifier == sm->current_identifier) { ret = 0; wpa_printf(MSG_DEBUG, "wps: ignore overlap identifier"); diff --git a/components/wpa_supplicant/test/CMakeLists.txt b/components/wpa_supplicant/test/CMakeLists.txt index b5f733cf75..99377e598e 100644 --- a/components/wpa_supplicant/test/CMakeLists.txt +++ b/components/wpa_supplicant/test/CMakeLists.txt @@ -2,7 +2,6 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}" PRIV_INCLUDE_DIRS "../src" "../esp_supplicant/src" PRIV_REQUIRES cmock esp_common test_utils wpa_supplicant mbedtls esp_wifi esp_event) -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") idf_component_get_property(esp_supplicant_dir wpa_supplicant COMPONENT_DIR) diff --git a/components/wpa_supplicant/test/test_eloop.c b/components/wpa_supplicant/test/test_eloop.c index a10f3287c6..b9be449cf3 100644 --- a/components/wpa_supplicant/test/test_eloop.c +++ b/components/wpa_supplicant/test/test_eloop.c @@ -1,9 +1,10 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ #include "string.h" +#include #include "esp_system.h" #include "unity.h" #include "esp_system.h" @@ -45,7 +46,7 @@ void callback(void *a, void *b) } t++; - ESP_LOGI("Eloop Test", "timer[%d] ran after %d msec of scheduled time", + ESP_LOGI("Eloop Test", "timer[%d] ran after %" PRId32 " msec of scheduled time", *i, ms_diff); } diff --git a/components/wpa_supplicant/test/test_offchannel.c b/components/wpa_supplicant/test/test_offchannel.c index a492cb3ce4..15c8715f66 100644 --- a/components/wpa_supplicant/test/test_offchannel.c +++ b/components/wpa_supplicant/test/test_offchannel.c @@ -11,6 +11,7 @@ */ #include "string.h" +#include #include "esp_system.h" #include "unity.h" #include "esp_system.h" @@ -135,7 +136,7 @@ void esp_send_action_frame(uint8_t *dest_mac, const uint8_t *buf, uint32_t len, req->rx_cb = dummy_rx_action; memcpy(req->data, buf, req->data_len); - ESP_LOGI(TAG, "Action Tx - MAC:" MACSTR ", Channel-%d, WaitT-%d", + ESP_LOGI(TAG, "Action Tx - MAC:" MACSTR ", Channel-%d, WaitT-%" PRId32 "", MAC2STR(dest_mac), channel, wait_time_ms); TEST_ESP_OK(esp_wifi_action_tx_req(WIFI_OFFCHAN_TX_REQ, channel, wait_time_ms, req));