diff --git a/examples/protocols/esp_local_ctrl/main/CMakeLists.txt b/examples/protocols/esp_local_ctrl/main/CMakeLists.txt index 8296886cc0..cb680e3bce 100644 --- a/examples/protocols/esp_local_ctrl/main/CMakeLists.txt +++ b/examples/protocols/esp_local_ctrl/main/CMakeLists.txt @@ -1,4 +1,3 @@ idf_component_register(SRCS "app_main.c" "esp_local_ctrl_service.c" INCLUDE_DIRS "." EMBED_TXTFILES "certs/servercert.pem" "certs/prvtkey.pem") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/protocols/esp_local_ctrl/main/esp_local_ctrl_service.c b/examples/protocols/esp_local_ctrl/main/esp_local_ctrl_service.c index 8ddbce3d4b..4dc3e9c100 100644 --- a/examples/protocols/esp_local_ctrl/main/esp_local_ctrl_service.c +++ b/examples/protocols/esp_local_ctrl/main/esp_local_ctrl_service.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -191,7 +192,7 @@ static esp_err_t set_property_values(size_t props_count, break; case PROP_TYPE_INT32: { const int32_t *new_value = (const int32_t *) prop_values[i].data; - ESP_LOGI(TAG, "Setting %s value to %d", props[i].name, *new_value); + ESP_LOGI(TAG, "Setting %s value to %" PRId32, props[i].name, *new_value); memcpy(props[i].ctx, new_value, sizeof(int32_t)); } break; diff --git a/examples/protocols/http_server/captive_portal/main/CMakeLists.txt b/examples/protocols/http_server/captive_portal/main/CMakeLists.txt index 9694baee81..3e85f1d9b4 100644 --- a/examples/protocols/http_server/captive_portal/main/CMakeLists.txt +++ b/examples/protocols/http_server/captive_portal/main/CMakeLists.txt @@ -1,4 +1,3 @@ idf_component_register(SRCS "main.c" "dns_server.c" INCLUDE_DIRS "include" EMBED_FILES root.html) -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/protocols/http_server/captive_portal/main/dns_server.c b/examples/protocols/http_server/captive_portal/main/dns_server.c index fdc74469d2..fbe0b74436 100644 --- a/examples/protocols/http_server/captive_portal/main/dns_server.c +++ b/examples/protocols/http_server/captive_portal/main/dns_server.c @@ -8,6 +8,7 @@ */ #include +#include #include "esp_log.h" #include "esp_system.h" @@ -149,7 +150,7 @@ static int parse_dns_request(char *req, size_t req_len, char *dns_reply, size_t esp_netif_ip_info_t ip_info; esp_netif_get_ip_info(esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"), &ip_info); - ESP_LOGD(TAG, "Answer with PTR offset: 0x%X and IP 0x%X", ntohs(answer->ptr_offset), ip_info.ip.addr); + ESP_LOGD(TAG, "Answer with PTR offset: 0x%" PRIX16 " and IP 0x%" PRIX32, ntohs(answer->ptr_offset), ip_info.ip.addr); answer->addr_len = htons(sizeof(ip_info.ip.addr)); answer->ip_addr = ip_info.ip.addr; diff --git a/examples/protocols/https_mbedtls/main/CMakeLists.txt b/examples/protocols/https_mbedtls/main/CMakeLists.txt index 4807bc71de..bdc0271b9c 100644 --- a/examples/protocols/https_mbedtls/main/CMakeLists.txt +++ b/examples/protocols/https_mbedtls/main/CMakeLists.txt @@ -3,4 +3,3 @@ # (If this was a component, we would set COMPONENT_EMBED_TXTFILES here.) idf_component_register(SRCS "https_mbedtls_example_main.c" INCLUDE_DIRS ".") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c index 97f2f0dae5..fec4e5e732 100644 --- a/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c +++ b/examples/protocols/https_mbedtls/main/https_mbedtls_example_main.c @@ -13,6 +13,7 @@ */ #include #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_wifi.h" @@ -243,7 +244,7 @@ static void https_get_task(void *pvParameters) static int request_count; ESP_LOGI(TAG, "Completed %d requests", ++request_count); - printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size()); + printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); for(int countdown = 10; countdown >= 0; countdown--) { ESP_LOGI(TAG, "%d...", countdown); diff --git a/examples/protocols/https_request/main/CMakeLists.txt b/examples/protocols/https_request/main/CMakeLists.txt index ae6944b107..c3c1ddb0c1 100644 --- a/examples/protocols/https_request/main/CMakeLists.txt +++ b/examples/protocols/https_request/main/CMakeLists.txt @@ -4,4 +4,3 @@ idf_component_register(SRCS "https_request_example_main.c" "time_sync.c" INCLUDE_DIRS "include" EMBED_TXTFILES server_root_cert.pem local_server_cert.pem) -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/protocols/https_request/main/https_request_example_main.c b/examples/protocols/https_request/main/https_request_example_main.c index 70e7f9b398..f386ed4e2a 100644 --- a/examples/protocols/https_request/main/https_request_example_main.c +++ b/examples/protocols/https_request/main/https_request_example_main.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include "freertos/FreeRTOS.h" @@ -255,7 +256,7 @@ static void https_request_task(void *pvparameters) #if CONFIG_MBEDTLS_CERTIFICATE_BUNDLE https_get_request_using_crt_bundle(); #endif - ESP_LOGI(TAG, "Minimum free heap size: %d bytes", esp_get_minimum_free_heap_size()); + ESP_LOGI(TAG, "Minimum free heap size: %" PRIu32 " bytes", esp_get_minimum_free_heap_size()); https_get_request_using_cacert_buf(); https_get_request_using_global_ca_store(); ESP_LOGI(TAG, "Finish https_request example"); diff --git a/examples/security/flash_encryption/main/CMakeLists.txt b/examples/security/flash_encryption/main/CMakeLists.txt index 6baa30745b..75ea85b111 100644 --- a/examples/security/flash_encryption/main/CMakeLists.txt +++ b/examples/security/flash_encryption/main/CMakeLists.txt @@ -1,3 +1,2 @@ idf_component_register(SRCS "flash_encrypt_main.c" INCLUDE_DIRS ".") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/security/flash_encryption/main/flash_encrypt_main.c b/examples/security/flash_encryption/main/flash_encrypt_main.c index b5636e5316..a38d7c465c 100644 --- a/examples/security/flash_encryption/main/flash_encrypt_main.c +++ b/examples/security/flash_encryption/main/flash_encrypt_main.c @@ -7,6 +7,7 @@ CONDITIONS OF ANY KIND, either express or implied. */ #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "soc/efuse_reg.h" @@ -106,9 +107,8 @@ static void example_print_chip_info(void) printf("Get flash size failed"); return; } - - printf("%dMB %s flash\n", flash_size / (1024 * 1024), - (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); + printf("%" PRIu32 "MB %s flash\n", flash_size / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); } @@ -116,7 +116,7 @@ static void example_print_flash_encryption_status(void) { uint32_t flash_crypt_cnt = 0; esp_efuse_read_field_blob(TARGET_CRYPT_CNT_EFUSE, &flash_crypt_cnt, TARGET_CRYPT_CNT_WIDTH); - printf("FLASH_CRYPT_CNT eFuse value is %d\n", flash_crypt_cnt); + printf("FLASH_CRYPT_CNT eFuse value is %" PRIu32 "\n", flash_crypt_cnt); esp_flash_enc_mode_t mode = esp_get_flash_encryption_mode(); if (mode == ESP_FLASH_ENC_MODE_DISABLED) { @@ -134,7 +134,7 @@ static void example_read_write_flash(void) ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage"); assert(partition); - printf("Erasing partition \"%s\" (0x%x bytes)\n", partition->label, partition->size); + printf("Erasing partition \"%s\" (0x%" PRIx32 " bytes)\n", partition->label, partition->size); ESP_ERROR_CHECK(esp_partition_erase_range(partition, 0, partition->size));