Switched off Maintainer mode by default as it gave wrong compiler warnings (as it added -Wall after some switches was already turned off)

cmake/maintainer.cmake:
  Add -DFORCE_INIT_OF_VARS to not get warnings generated by -Wall
configure.cmake:
  Don't add -Wall if we already have it. This is to not enable options that are already turned off.
support-files/compiler_warnings.supp:
  Removed suppression that is not needed anymore
This commit is contained in:
Michael Widenius 2012-06-13 19:21:28 +03:00
parent 94d68777bb
commit 8294226097
4 changed files with 11 additions and 13 deletions

View file

@ -105,7 +105,7 @@ ENDIF()
#
INCLUDE(maintainer)
SET(MYSQL_MAINTAINER_MODE "AUTO" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
SET(MYSQL_MAINTAINER_MODE "OFF" CACHE STRING "MySQL maintainer-specific development environment. Options are: ON OFF AUTO.")
MARK_AS_ADVANCED(MYSQL_MAINTAINER_MODE)
# Whether the maintainer mode compiler options should be enabled.
@ -261,16 +261,18 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE()
#
# Setup maintainer mode options by the end. Platform checks are
# Setup maintainer mode options. Platform checks are
# not run with the warning options as to not perturb fragile checks
# (i.e. do not make warnings into errors).
# We have to add MAINTAINER_C_WARNINGS first to ensure that the flags
# given by the invoking user are honored
#
IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
SET(CMAKE_C_FLAGS "${MY_MAINTAINER_C_WARNINGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MY_MAINTAINER_C_WARNINGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MY_MAINTAINER_CXX_WARNINGS}")
SET(CMAKE_C_FLAGS_DEBUG "${MY_MAINTAINER_C_WARNINGS} ${CMAKE_C_FLAGS_DEBUG}")
SET(CMAKE_CXX_FLAGS_DEBUG "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS_DEBUG}")
ENDIF()
IF(WITH_UNIT_TESTS)

View file

@ -18,7 +18,7 @@ INCLUDE(CheckCCompilerFlag)
# Setup GCC (GNU C compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
SET(MY_MAINTAINER_WARNINGS
"-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing")
"-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -DFORCE_INIT_OF_VARS")
CHECK_C_COMPILER_FLAG("-Wno-missing-field-initializers"
HAVE_NO_MISSING_FIELD_INITIALIZERS)

View file

@ -55,10 +55,10 @@ ENDIF()
# Always enable -Wall for gnu C/C++
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF()

View file

@ -129,10 +129,6 @@ signal\.c : .*unused parameter.*
# Aria warning that is ok in debug builds
#
storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
# This warning is strange; We should not get it with -DFORCE_INIT_OF_VARS
# I added the suprression as I was not able to remove this warning :(
storage/maria/ma_check.c: may be used uninitialized in this function : 1200-1500
#
# Pbxt