Skip to content

Add configuration option for --warnings (and maybe --optimize-for-debug) #1085

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

Open
matthijskooijman opened this issue Nov 25, 2020 · 5 comments
Labels
criticality: medium Of moderate impact priority: low Resolution is a low priority type: enhancement Proposed improvement

Comments

@matthijskooijman
Copy link
Collaborator

Bug Report

Current behavior

arduino-cli compile has a --warnings option to enable warnings for a single compilation run.

Expected behavior

I would like to be able to set a default value for --warnings in my config file (i.e. to enable warnings on all compilations).

Environment

  • CLI version (output of arduino-cli version): recent git master
  • OS and platform: Linux, x86_64.
@ubidefeo
Copy link

@matthijskooijman
would you really want --optimize-for-debug on as a default?
I think it's kinda counterproductive unless you add it to an extra config file that you point to during heavy development days, but seems like a stretch :D

maybe we could add a -o shortcut for that flag since it's available (cc @silvanocerza )

@matthijskooijman
Copy link
Collaborator Author

matthijskooijman commented Nov 30, 2020

would you really want --optimize-for-debug on as a default?

Possibly, yes. 99% (or something like that) of the uploads I do are during development, for testing, only a fraction is actually uploading a final product (and even then -Og is not really problematic). And regardless, it seems like something that would be easy to implement and the type of option that would make sense as a config directive along with enabling warnings, even if not a lot of people would end up using it.

maybe we could add a -o shortcut for that flag since it's available (cc @silvanocerza )

That could also be a good idea, though I'd consider doing this in addition to adding a config option.

Maybe -d (for "debug") or -g (matching gcc) would be better, though?

@ubidefeo
Copy link

Possibly, yes. 99% (or something like that) of the uploads I do are during development

living on the edge :D

I'll push for a config setting, and I think I'd go for -d to keep it closer to debug unless -d can be confusing for some reason

@matthijskooijman
Copy link
Collaborator Author

Sounds good, thanks!

Just realized that this also means a --no-optimize-for-debug is needed, to reverse the setting from the config file (for the 1% where you do want to make a production build).

@per1234 per1234 reopened this Mar 30, 2021
@ubidefeo ubidefeo added the priority: medium Resolution is a medium priority label Apr 16, 2021
@rsora rsora added criticality: medium Of moderate impact and removed priority: medium Resolution is a medium priority labels Nov 2, 2021
@umbynos umbynos added the priority: low Resolution is a low priority label Nov 25, 2022
@gilman88
Copy link

gilman88 commented Jun 6, 2023

Hi just wanted to +1 having a warnings config setting since I prefer to see them. In particular this is because the permissive flag that is passed to the compiler is downgrading some errors and then they were being squashed due to the default warnings value.
An extra bonus would be if we could also have a flag/setting to prevent the permissive flag being sent to the compiler :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: medium Of moderate impact priority: low Resolution is a low priority type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

7 participants