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 flag to change compiler warnings #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nsasch
Copy link

@nsasch nsasch commented May 18, 2020

This adds support for a --compiler-warnings-all flag to build_platform.py. When set, arduino-cli compile ... is run with --warnings all. It does this in simple way, without an args-parsing library, which limits configurability.

This is opt-in, where each library must add this flag. I'm interested in feedback and ideas about this decision.

Another option I'm considering is to making this the default, but maintaining two methods to opt-out.

  1. A list inside build_platform.py for all libraries that don't currently pass with the new setting. This list would shrink to zero eventually; nothing new should be added.
  2. A new --compiler-warnings-default flag for libraries that really don't want this new setting. If an existing library will opt-out indefinitely, it should use the opt-out flag and be removed from the opt-out list in build_platform.py

See this PR which demonstrates how this can catch bugs for platforms (specifically ESP32) where "compiler.warning_flags=all" includes -Werror and can break.

@tekktrik
Copy link
Member

Hi @nsasch - are you still interested in this PR? I'm inclined to close it, but if you wanted to resolve the merge conflicts I'd love to take a look.

@tekktrik tekktrik self-requested a review May 18, 2023 20:20
@per1234
Copy link
Contributor

per1234 commented May 18, 2023

An alternative approach would be to add a general purpose flag to the script that allows the user to add any arbitrary flags to the arduino-cli compile commands the script invokes.

Something like this:

python3 build_platform.py --cli-compile-flag "--warnings all"

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

Successfully merging this pull request may close these issues.

3 participants