Coming from my branch of high-reliability embedded systems, we have an imperative that
-Werror always be turned on. We accompany this with as much warning pedantry as the compiler allows.
While this runs into issues when using third party code as there is only so far that this can be controlled, it’s still a great ideal and any safety-critical systems really must compile without warnings.
I have been unable to use the
-Werror flag (via. inserting
CFLAGS += -Werror -Wfatal-errors into the top of
deviceOS/?/?/build/arm-tools.mk, if anyone is interested) when compiling my app because of thousands of warnings which are coming from Particle’s toolkit. Some are trivial, such as
extra ';' in the NRF SDK; but some are more architecturally important, such as enum values not being handled in a
spark_wiring_ble.cpp; or implicit casts from ‘float’ to ‘double’ in
This is a large conversation, but I’d like to know what Particle devs think about turning on more warnings by default. It really helps a codebase’s clarity and stability to resolve all the various warnings. I can’t count the number of times I’ve found subtle bugs by resolving all warnings.
 See https://github.com/rethinkdb/rethinkdb/issues/5177#issuecomment-169424548 for a nice read on why
default should only be used to catch out-of-band enum values, and all defined enums should exhaustively be handled.