Docs: add an entry about compiler warnings by mcspr · Pull Request #8492 · esp8266/Arduino (original) (raw)

only 3 out of 4 options produce error:

compiler.warning_flags=-w -Werror=return-type
compiler.warning_flags.none=-w -Werror=return-type
compiler.warning_flags.default=-Werror=return-type
compiler.warning_flags.more=-Wall -Werror=return-type
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type

'None' never does, -w overrides any -W flags since they apply all at once and not like 'disable all warnings but still enable this one', order does not matter. Removing -w from 'None' kind of defeats the purpose of the option, and there is 'Default' for that.

We do still need to mention the warnings, which even in 'Default' will give some useful advice. Specifically with C++, shouldn't we mention that it is undefined behaviour when trying to code like that?

btw low-level routines that really do not return may still be coded like this

int func() { __builtin_unreachable(); }