Browse Source

esp_local_ctrl: remove "Wno-format" cflag and fix formatting errors

Mahavir Jain 3 years ago
parent
commit
b709c84e1c

+ 0 - 2
components/esp_local_ctrl/CMakeLists.txt

@@ -24,5 +24,3 @@ idf_component_register(SRCS "${srcs}"
                     PRIV_REQUIRES protobuf-c)
 
 idf_component_optional_requires(PRIVATE espressif__mdns mdns)
-
-target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

+ 3 - 2
components/esp_local_ctrl/src/esp_local_ctrl.c

@@ -6,6 +6,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <inttypes.h>
 #include <esp_err.h>
 #include <esp_log.h>
 
@@ -355,7 +356,7 @@ esp_err_t esp_local_ctrl_get_prop_values(size_t total_indices, uint32_t *indices
     /* Convert indices to names */
     for (size_t i = 0; i < total_indices; i++) {
         if (indices[i] >= local_ctrl_inst_ctx->props_count) {
-            ESP_LOGE(TAG, "Invalid property index %d", indices[i]);
+            ESP_LOGE(TAG, "Invalid property index %" PRId32, indices[i]);
             return ESP_ERR_INVALID_ARG;
         }
         props[i].name  = local_ctrl_inst_ctx->props[indices[i]]->name;
@@ -396,7 +397,7 @@ esp_err_t esp_local_ctrl_set_prop_values(size_t total_indices, uint32_t *indices
     }
     for (size_t i = 0; i < total_indices; i++) {
         if (indices[i] >= local_ctrl_inst_ctx->props_count) {
-            ESP_LOGE(TAG, "Invalid property index %d", indices[i]);
+            ESP_LOGE(TAG, "Invalid property index %" PRId32, indices[i]);
             free(props);
             return ESP_ERR_INVALID_ARG;
         }