Enabling Compiler Warnings with CubeCell & PlatformIO

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

Hi max-plastix,

The build settings when using “framework = arduino” can be found here:
05

CCFLAGS contains the command-line options for C and C++ and looks like this:
20

When you remove “-w” (surpress all warnings) you will see your warnings, and also many more…

Thank you! That worked great. It’s certainly showing Warnings now.

So many warnings…

-Wall -Wno-comment

is pretty good, then go to Problems in PlatformIO and focus on my own code.