ESP32 Compilation Warnings

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.
Post Reply
mnfisher
Valued Contributor
Posts: 983
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

ESP32 Compilation Warnings

Post by mnfisher »

A little tip to make life easier.

The output from the esp32 compiler is a 'little' verbose. It is possible to turn off some of the warnings.

In your project directory/main

Edit CMakeLists.txt

At the end of the file add:

Code: Select all

target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-variable)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-function)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-int-conversion)
This will turn off unused variable and function warnings as well as conversion between integer types. Obviously you should aim to tidy up the code that gives these messages - but it makes spotting the error 'needle' easier in the early project haystack...

Martin

Other warnings can be disabled using similar syntax....

Post Reply