server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-34408 Create a MY_WARNING_FLAGS_NON_FATAL for testing warnings

Open grooverdan opened this issue 1 year ago • 3 comments

  • [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.

grooverdan avatar Jun 14 '24 03:06 grooverdan

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 14 '24 10:06 CLAassistant

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.

vuvova avatar Jun 14 '24 12:06 vuvova

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).

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

grooverdan avatar Jun 17 '24 06:06 grooverdan

merged in https://github.com/MariaDB/server/commit/971a0ba23c18d81f73076351cf426467282a1aef

grooverdan avatar Dec 11 '24 21:12 grooverdan