-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document compiler warning_level project option #3275
Comments
I think this can be closed? The documentation is here: https://mesonbuild.com/Builtin-options.html# |
Excellent, thanks! |
So, what do those levels actually mean? 3 being "the most strict" doesn't really say much, when I don't know which warnings are enabled. That would have been fine in the past, but with current version, meson actually spews warnings about "please use this vague option instead of manually using |
I agree about that. I have read the GCC manpage and have a pretty exact idea which warnings I would like to enable. Furthermore, there should be an easy copy&paste snippet on the documentation page. If I write
And I don’t find any indication on how this option is being used correctly. Therefore, I would like to suggest that the warning I assume that this feature is intended as some compiler-agnostic warning setting, but when I don’t care about other compilers, just let me set my flags as I would like without printing something like this. |
Worse is the fact that:
But some projects want |
It would be nice if the above was documented to include the corresponding warning flags for different languages |
I submitted #7973 to stop meson from reprimanding you if you manually add -Wpedantic, did not (currently) try to document the flags each level add though. |
What about -Werror? |
Given there is a dedicated option just for Werror, I think it's perfectly reasonable that people should use that built-in option. There is no case where using it would also have the side effect of adding things you don't want to add, like there was with -Wpedantic. |
Makefile options were more restrictive and produced more warnings. This patch adds missing warning options into meson build. Makefile also has -Wall and -Wextra specified explicitly, however this is covered by warning_level=2 which is already set in meson.build. warning_level info: mesonbuild/meson#3275 There are few warning options that are present in meson, but not in Makefile. These are left as is. TEST=ninja test shows no warnings and tests pass Change-Id: Id401bfd642dc3c13d85bd9a2dba56ada38714c25 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/58561 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
I beg to differ. There are projects which want to turn on -Werror when building from a git repo (i.e. when .git dir exists) but not when building from a release tarball as the latter maybe run on plethora of systems unavailable to developers and thus may fail build needlessly. If we want projects to use builtin we need to give them an opportunity to set it outside of project(). |
That will fail the build needlessly when users build from a git checkout. |
Which is acceptable, because that's usually the case for advanced users building their own package (and they probably know ho to report this back to the project in question). Majority of users use distro shipped binary packages -> no problem. |
|
Is this documented somewhere? On a side note: It seems neither |
Maybe we should deprecate numerical values, and have more proper names. Like |
Searching for it in the documentation turns up nothing. It cost me quite a lot of source-diving to find out whether 1 or 3 was the most strict warning level.
The text was updated successfully, but these errors were encountered: