Skip to content

Commit c48e442

Browse files
fix(common): removed Wno-format flag and fixed formatting warnings
1 parent 19baa7d commit c48e442

File tree

27 files changed

+27
-41
lines changed

27 files changed

+27
-41
lines changed

components/asio/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ idf_component_register(SRCS ${asio_sources}
2727
INCLUDE_DIRS "asio/asio/include" "port/include"
2828
PRIV_INCLUDE_DIRS ${asio_priv_includes}
2929
REQUIRES lwip)
30-
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
3130

3231
if(CONFIG_ASIO_SSL_SUPPORT)
3332
if(CONFIG_ASIO_USE_ESP_WOLFSSL)

components/esp_modem/examples/modem_console/main/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ idf_component_register(SRCS "modem_console_main.cpp"
55
"ping_handle.c"
66
REQUIRES console esp_http_client nvs_flash
77
INCLUDE_DIRS ".")
8-
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

components/esp_modem/examples/modem_console/main/modem_console_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ extern "C" void app_main(void)
173173
ESP_LOGI(TAG, "Waiting for USB device connection...");
174174
auto dte = create_usb_dte(&dte_config);
175175
dte->set_error_cb([&](terminal_error err) {
176-
ESP_LOGI(TAG, "error handler %d", err);
176+
ESP_LOGI(TAG, "error handler %d", (int)err);
177177
if (err == terminal_error::DEVICE_GONE) {
178178
exit_signal.set(1);
179179
}
@@ -482,7 +482,7 @@ extern "C" void app_main(void)
482482
// wait for exit
483483
exit_signal.wait_any(1, UINT32_MAX);
484484
s_repl->del(s_repl);
485-
ESP_LOGI(TAG, "Exiting...%d", esp_get_free_heap_size());
485+
ESP_LOGI(TAG, "Exiting...%" PRIu32, esp_get_free_heap_size());
486486
#if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB)
487487
// USB example runs in a loop to demonstrate hot-plugging and sudden disconnection features.
488488
} // while (1)

components/esp_modem/examples/modem_console/main/ping_handle.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Unlicense OR CC0-1.0
55
*/
@@ -28,7 +28,7 @@ static void cmd_ping_on_ping_success(esp_ping_handle_t hdl, void *args)
2828
esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr));
2929
esp_ping_get_profile(hdl, ESP_PING_PROF_SIZE, &recv_len, sizeof(recv_len));
3030
esp_ping_get_profile(hdl, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time));
31-
ESP_LOGI(TAG, "%d bytes from %s icmp_seq=%d ttl=%d time=%d ms\n",
31+
ESP_LOGI(TAG, "%" PRIu32 " bytes from %s icmp_seq=%d ttl=%d time=%" PRIu32 " ms\n",
3232
recv_len, inet_ntoa(target_addr.u_addr.ip4), seqno, ttl, elapsed_time);
3333
}
3434

@@ -57,7 +57,7 @@ static void cmd_ping_on_ping_end(esp_ping_handle_t hdl, void *args)
5757
} else {
5858
ESP_LOGI(TAG, "\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&target_addr)));
5959
}
60-
ESP_LOGI(TAG, "%d packets transmitted, %d received, %d%% packet loss, time %dms\n",
60+
ESP_LOGI(TAG, "%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 " packet loss, time %" PRIu32 "ms\n",
6161
transmitted, received, loss, total_time_ms);
6262
// delete the ping sessions, so that we clean up all resources and can create a new ping session
6363
// we don't have to call delete function in the callback, instead we can call delete function from other tasks
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
idf_component_register(SRCS "modem_psm.c"
32
INCLUDE_DIRS ".")

components/esp_modem/examples/modem_tcp_client/main/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ idf_component_register(SRCS "modem_client.cpp"
99
"tcp_transport_at.cpp"
1010
"${device_srcs}"
1111
INCLUDE_DIRS ".")
12-
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

components/esp_modem/examples/modem_tcp_client/main/modem_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const int GOT_DATA_BIT = BIT2;
3434

3535
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data)
3636
{
37-
ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%d", base, event_id);
37+
ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%" PRId32, base, event_id);
3838
esp_mqtt_event_handle_t event = (esp_mqtt_event_handle_t)event_data;
3939
esp_mqtt_client_handle_t client = event->client;
4040
int msg_id;

components/esp_modem/examples/modem_tcp_client/main/sock_dce.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ bool DCE::at_to_sock()
120120
{
121121
uint64_t data;
122122
read(data_ready_fd, &data, sizeof(data));
123-
ESP_LOGD(TAG, "select read: modem data available %x", data);
123+
ESP_LOGD(TAG, "select read: modem data available %" PRIu64, data);
124124
if (!signal.wait(IDLE, 1000)) {
125125
ESP_LOGE(TAG, "Failed to get idle");
126126
close_sock();
127127
return false;
128128
}
129129
if (state != status::IDLE) {
130-
ESP_LOGE(TAG, "Unexpected state %d", state);
130+
ESP_LOGE(TAG, "Unexpected state %d", static_cast<int>(state));
131131
close_sock();
132132
return false;
133133
}
@@ -145,7 +145,7 @@ bool DCE::sock_to_at()
145145
return false;
146146
}
147147
if (state != status::IDLE) {
148-
ESP_LOGE(TAG, "Unexpected state %d", state);
148+
ESP_LOGE(TAG, "Unexpected state %d", static_cast<int>(state));
149149
close_sock();
150150
return false;
151151
}

components/esp_modem/examples/modem_tcp_client/main/sock_dce.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ esp_modem::return_type name(__VA_ARGS__);
128128
return false;
129129
}
130130
if (state != status::IDLE) {
131-
ESP_LOGE("dce", "Unexpected state %d", state);
131+
ESP_LOGE("dce", "Unexpected state %d", static_cast<int>(state));
132132
return false;
133133
}
134134
return true;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
idf_component_register(SRCS "pppos_client_main.c"
22
INCLUDE_DIRS ".")
3-
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

0 commit comments

Comments
 (0)