server
server copied to clipboard
MDEV-34408 Create a MY_WARNING_FLAGS_NON_FATAL for testing warnings
- [x] The Jira issue number for this PR is: MDEV-______
Description
Test -Wreorder and -Weffc++ as suggested by @dr-m and @montywi. This will be in DEBUG and RelWithDebugInfo builds as a place for developers to try and test new compiler warnings. -Wno-error= is applied to these to ensure they are non-fatal on on compiler version in Buildbot or developer versions.
MY_CHECK_AND_SET_COMPILER_FLAG extended with "noerror" argument which affects subsequently specified CMAKE_BUILD_TYPES or all if no further arguments.
Release Notes
Builder consideration only.
How can this PR be tested?
BB tests new flags.
Basing the PR against the correct MariaDB version
- [ ] This is a new feature and the PR is based against the latest MariaDB development branch.
- [ ] This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.
- [X] This is an enhancement to QA testing that is non-fatal to build process
PR quality check
- [X] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [X] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
I don't understand that at all. First, why "noerror" argument, when one can simply write
SET(MY_WARNING_FLAGS_NON_FATAL
-Wno-error=reorder
-Wno-error=effc++
)
or even
FOREACH(F ${MY_WARNING_FLAGS_NON_FATAL})
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-error=${F} DEBUG RELWITHDEBINFO)
ENDFOREACH()
(removing -W from MY_WARNING_FLAGS_NON_FATAL).
Second, why do you disable errors for -Wreorder ?
Third why -Weffc++ ? Even standard library doesn't follow these rules.
I don't understand that at all. First, why "noerror" argument, when one can simply write
SET(MY_WARNING_FLAGS_NON_FATAL -Wno-error=reorder -Wno-error=effc++ )or even
FOREACH(F ${MY_WARNING_FLAGS_NON_FATAL}) MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-error=${F} DEBUG RELWITHDEBINFO) ENDFOREACH()(removing
-WfromMY_WARNING_FLAGS_NON_FATAL).
Nice - took that option.
Second, why do you disable errors for
-Wreorder?
Applied to full status for `-Wreorder'
Third why
-Weffc++? Even standard library doesn't follow these rules.
Was @dr-m's suggestion. On 10.5 there where no errors.
Excluded from rocksdb due to excess warnings previously however - https://buildbot.mariadb.org/#/builders/535/builds/18085
merged in https://github.com/MariaDB/server/commit/971a0ba23c18d81f73076351cf426467282a1aef