Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a set_fail_on_compiler_warning function #12

Open
per1234 opened this issue Jun 26, 2017 · 0 comments
Open

Add a set_fail_on_compiler_warning function #12

per1234 opened this issue Jun 26, 2017 · 0 comments

Comments

@per1234
Copy link
Owner

per1234 commented Jun 26, 2017

Setting this to true will cause the build to fail if any sketch build causes a compiler warning.

Due to warnings caused by external dependencies such as libraries or hardware core files, it is not always possible for a project to be completely free from warnings but when this is possible it's useful to be able to enforce a zero warnings policy.

The cleanest way to achieve this is to simply set -Werror=all via compiler.cpp.extra_flags and compiler.c.extra_flags properties. This is dependent on the hardware package correctly implementing the extra_flags properties. This will NOT catch warnings generated by the preprocessor such as via the #warning directive or:

#define FOO-BAR
warning: ISO C++11 requires whitespace after the macro name

The other option is to simply use the script's warning count. This a bit more fragile since it relies on parsing the compiler output and thus does have the potential for false positives or false negatives.

The benefit of this option is I could set a maximum warning count so that you can still use the function when there are some warnings that can't be fixed (e.g., they're caused by external code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant