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.
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 -Wall -Wextra", and I find that risky when it's not even documented what it's meant to mean exactly.
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 warning_level(3), I get:
meson.build:2:0: ERROR: Unknown function "warning_level".
And I don鈥檛 find any indication on how this option is being used correctly.
Therefore, I would like to suggest that the warning WARNING: Consider using the builtin warning_level option instead of adding warning flags by hand. is removed.
I assume that this feature is intended as some compiler-agnostic warning setting, but when I don鈥檛 care about other compilers, just let me set my flags as I would like without printing something like this.
Worse is the fact that:
-Wall,-Wextra,-WpedanticBut some projects want -Wall and -Wpedantic, but refuse to add -Wextra because it's not a stable definition. It's therefore impossible to use the meson option. So the warning is useless, as it will warn you about things you cannot change.
Worse is the fact that:
* warning_level 1 adds `-Wall`, -warning_level 2 adds warning_level 1 + `-Wextra`, * warning_level 3 adds warning_level 2 + `-Wpedantic`But some projects want
-Walland-Wpedantic, but refuse to add-Wextrabecause it's not a stable definition. It's therefore impossible to use the meson option. So the warning is useless, as it will warn you about things you cannot change.
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.
Most helpful comment
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
-Wall -Wextra", and I find that risky when it's not even documented what it's meant to mean exactly.