Hello,
I am using esp-idf extension on VsCode and was able to flash my board using the blink example. However, now, using a different code, I am getting errors in esp_log.h:
C:/Espressif/esp-idf-v5.2.2/components/log/include/esp_log.h:291:27: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
291 | #define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
I am getting multiple format errors. Why would this be happening? Since these are libraries provided by ESP.
Is there a way I can remove "-Werror=format=" flag? Should I?
Errors in esp_log while Compiling
Re: Errors in esp_log while Compiling
uint32 (long int) must be printed with %ld. Instead of using compiler flags its better to adjust the failing %d formats.
I am using IDF 5.0.1 where there are no errors. So you shouldnt get any errors with newer versions.
I am using IDF 5.0.1 where there are no errors. So you shouldnt get any errors with newer versions.
-
- Posts: 1605
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Errors in esp_log while Compiling
And if you don't want to bother with (platform-specific) integer formatting strings, you can #include <inttypes.h> and use the macros it provides, like
Code: Select all
ESP_LOGI(TAG, "u32 value = " PRIu32 ", s8 value = " PRId8 , my_uint32, my_int8);
-
- Posts: 6
- Joined: Tue Jan 09, 2024 8:12 pm
Re: Errors in esp_log while Compiling
@leschge I went ahead and changed all the errors manually and now I have "Linking CXX executable UVC-Copy.elf
FAILED: UVC-Copy.elf" error where UVC-Copy is my project name
FAILED: UVC-Copy.elf" error where UVC-Copy is my project name
Who is online
Users browsing this forum: No registered users and 72 guests