I would like to enable Compiler Warnings for the code I am writing in main.cpp.
Without any Warnings, it’s easy to make mistakes that lead to crash and corruption issues, and writing warning-free code is good practice in general.
I have this line in my platformio.ini, which usually does the trick:
build_flags = -Wall -Wextra -Werror -Wl,-Map,output.map
But my code is compiled with warnings disabled. Even an intentional warning is ignored:
#warning "This should produce a warning"
How do I modify platformio.ini or the code to ENABLE compiler warnings?
My full PlatformIO.ini is:
[env:cubecell_gps]
platform = asrmicro650x
board = cubecell_gps
framework = arduino
build_flags = -Wall -Wextra -Werror -Wl,-Map,output.map
monitor_speed = 115200
board_build.arduino.lorawan.region = US915
board_build.arduino.lorawan.class = CLASS_A
board_build.arduino.lorawan.netmode = OTAA
board_build.arduino.lorawan.adr = OFF
board_build.arduino.lorawan.uplinkmode = UNCONFIRMED
board_build.arduino.lorawan.net_reserve = ON
board_build.arduino.lorawan.rgb = ACTIVE
board_build.arduino.lorawan.debug_level = FREQ_AND_DIO
board_build.arduino.lorawan.at_support = OFF