I’m working on old code again, this time for ESP32. Code that worked perfectly fine and that is clearly readable (at least to me with 30+ years of coding experience in different languages). Now some new compiler came along and told me to be as clear as I’d be talking to a fool. I don’t like that attitude. So I’m going to change the compiler, not the code.
Unfortunately, I’m not a C expert (more C#) and don’t know how to configure this specific kind of compiler. I’m using PlatformIO in VSCode and would like to tell the compiler that every child knows the && before || rule just like * before +. The “error” suggestion mentions -Werror=parentheses which I believe is a compiler commandline flag. But how and where can I shut that thing down?
PS: And this as well: -Wincompatible-pointer-types It’s everywhere and seems to be completely blind. To me, uint8_t* is the same as uint8_t*. And it doesn’t matter what I pass to a void* unused parameter.
The compiler doesn’t change by itself. Something must happened.
Did you know that you can specify the platform version per project?
For example:
platform = espressif32 @ 3.5.0
This will stick your project to Espressif Arduino 1.0.6 with ESP-IDF 3.3.5 even if you have a newer platform version installed on your system (like 6.10.0 which is the latest official available).
When you said you’re working on an older project… what was the current platform version at that time? Stick your project to that version, same as you do with used library versions.
Thank you, this helps. It generates new warnings but I guess I can ignore those:
…
Compiling .pio\build\pico32\nvs_flash\src\nvs_page.cpp.o
cc1plus.exe: warning: command-line option '-Wno-incompatible-pointer-types' is valid for C/ObjC but not for C++
Compiling .pio\build\pico32\nvs_flash\src\nvs_pagemanager.cpp.o
cc1plus.exe: warning: command-line option '-Wno-incompatible-pointer-types' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command-line option '-Wno-incompatible-pointer-types' is valid for C/ObjC but not for C++
(and a few more files)
…
That explicit version seems to be tied to Arduino, I don’t understand what that has to do with it. I’m not using Arduino, but it’s mentioned everywhere. Can I have esp-idf without it as well?
Now that it works with the current version, I’d at least like to pin that one, not one that may have been current around 2 years ago, whatever that was.
I also find all these numbers very confusing. Your link says “6.10.0” in an arbitrary table and column is esp-idf 4.4.7 but the platforms data in PIO Home says “6.10.0” is installed and contains the package framework-espidf in version “3.50400.0 (5.4.0)” (more confusing numbers here) which might be newer than everything mentioned on that page.
Yes, that’s correct. I usually only use Arduino, that’s why I only list Arduino based versions there. I didn’t know what you are using - it was just a guess.
Every platform version has a specific Arduino Version and this is built on a specific ESP-IDF version.
Espressif32 platform 6.10.0 has Arduino 2.0.17 which is bulilt on ESP-IDF 4.4.7.
But that’s not interesting for you. Since you are using pure ESP-IDF you are interested in that.
You’ll find the necessary versions in the release infos:
So with platform = espressif32 @ 6.10.0 you have ESP-IDF 5.4.0 in a framework = espidf project.
And the toolchain used is also bundled to that specific ESP-IDF version. You should find additionally info’s for that in the ESP-IDF release infos.