FYI, this is using PlatformIo with the Arduino framework. The warning cannot be disabled with a compiler setting, as -Wnp-discarded-qualifiers is not allowed with a C++ compiler….
Compiling .pio\build\esp32s3mykorvo\lib8f9\lvgl\core\lv_obj_tree.c.o
.pio/libdeps/esp32s3mykorvo/lvgl/src/core/lv_obj.c: In function 'lv_init':
.pio/libdeps/esp32s3mykorvo/lvgl/src/core/lv_obj.c:143:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
char * txt = "Á";
^~~~
Compiling .pio\build\esp32s3mykorvo\lib8f9\lvgl\core\lv_refr.c.o
And too many strings in my code is marked with this warning.
Seems as platformio issue
You can suppress in ini set py scripts
and create file
Import("env")
# General options that are passed to the C and C++ compilers
#env.Append(CCFLAGS=["flag1", "flag2"])
# General options that are passed to the C compiler (C only; not C++).
env.Append(CFLAGS=["-Wno-discarded-qualifiers"])
# General options that are passed to the C++ compiler
#env.Append(CXXFLAGS=["flag1", "flag2"])
Yes, I have experienced this with the latest version today. The previous version that I was using did not seem to have it. After writing custom functions, for some reason I cant access them in the events.c file either.
Thanks for your feedback. Unfortunately, the extra_scripts workaround does not work around the issue :). The extra script is named in the platformio.ini, it is invoked (as verified by an print statement), but to no avail, the gazillion warnings still get issued.
Anyhow, suppressing warnings is not the “right thing to do” ™. There should be no warning messages in the first place.