system: fix printf format errors in all system and cxx examples

This commit is contained in:
Marius Vikhammer
2022-12-09 15:04:55 +08:00
parent 12a069d593
commit f81cae4e1e
37 changed files with 64 additions and 68 deletions

View File

@@ -1,5 +1,3 @@
idf_component_register(SRCS "cmd_nvs.c"
INCLUDE_DIRS .
REQUIRES console nvs_flash)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@@ -292,12 +292,12 @@ static esp_err_t get_value_from_nvs(const char *key, const char *str_type)
} else if (type == NVS_TYPE_I32) {
int32_t value;
if ((err = nvs_get_i32(nvs, key, &value)) == ESP_OK) {
printf("%d\n", value);
printf("%"PRIi32"\n", value);
}
} else if (type == NVS_TYPE_U32) {
uint32_t value;
if ((err = nvs_get_u32(nvs, key, &value)) == ESP_OK) {
printf("%u\n", value);
printf("%"PRIu32"\n", value);
}
} else if (type == NVS_TYPE_I64) {
int64_t value;