From 86d00aa5fdcb7eb1c2981e6f0ec8bd4473b4cdce Mon Sep 17 00:00:00 2001 From: Anuj Deshpande Date: Wed, 24 Apr 2024 17:54:11 +0530 Subject: [PATCH] [fdb] Fixes to build for IDF w/o errors (#293) --- demos/esp32_spi_flash/CMakeLists.txt | 2 ++ samples/tsdb_sample.c | 2 +- src/fdb.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/esp32_spi_flash/CMakeLists.txt b/demos/esp32_spi_flash/CMakeLists.txt index 866defc..79fac9e 100644 --- a/demos/esp32_spi_flash/CMakeLists.txt +++ b/demos/esp32_spi_flash/CMakeLists.txt @@ -7,4 +7,6 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake) list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components") +add_compile_definitions(FDB_USING_TIMESTAMP_64BIT) project(esp32_spi_flash) +idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND) diff --git a/samples/tsdb_sample.c b/samples/tsdb_sample.c index 173ceb1..4912e45 100644 --- a/samples/tsdb_sample.c +++ b/samples/tsdb_sample.c @@ -21,7 +21,7 @@ #define FDB_LOG_TAG "[sample][tsdb]" #ifdef FDB_USING_TIMESTAMP_64BIT -#define __PRITS "ld" +#define __PRITS "lld" #else #define __PRITS "d" #endif diff --git a/src/fdb.c b/src/fdb.c index 021aa90..8de2b2a 100644 --- a/src/fdb.c +++ b/src/fdb.c @@ -74,7 +74,7 @@ fdb_err_t _fdb_init_ex(fdb_db_t db, const char *name, const char *path, fdb_db_t } else { /* must be aligned with block size */ if (db->sec_size % block_size != 0) { - FDB_INFO("Error: db sector size (%" PRIu32 ") MUST align with block size (%" PRIu32 ").\n", db->sec_size, block_size); + FDB_INFO("Error: db sector size (%" PRIu32 ") MUST align with block size (%zu).\n", db->sec_size, block_size); return FDB_INIT_FAILED; } }