Add -Wuseless-cast to the pedantic flags.

This commit is contained in:
Mark de Wever 2012-10-07 09:17:47 +00:00
parent 36f05a020d
commit 7a3fa073da
3 changed files with 15 additions and 2 deletions

View File

@ -314,6 +314,12 @@ check_compiler_has_flag(
HAS_COMPILER_FLAG_WMISMATCHED_TAGS
)
check_compiler_has_flag(
CXX_FLAGS_PEDANTIC_COMPILATION
"-Wuseless-cast"
HAS_COMPILER_FLAG_WUSELESS_CAST
)
### Set the final compiler flags.

View File

@ -62,6 +62,7 @@ Version 1.11.0+svn:
* Fix OOS when dismissing a recall in a multiplayer campaign (bug #19924).
* Fixed a bug disallowing the left shift and meta key to be detected in
the hotkeys
* Added -Wuseless-cast to the CMake pedantic flags.
Version 1.11.0:
* Add-ons client:

View File

@ -309,14 +309,20 @@ add_library(wesnoth-lua ${LIBRARY_TYPE} EXCLUDE_FROM_ALL ${libwesnoth-lua_STAT_S
# uses it. Force the flag off for these files. (We don't enable it in our
# generic compiler flags, but allows people to do it.)
if(CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(wesnoth-lua PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
set_target_properties(wesnoth-lua
PROPERTIES COMPILE_FLAGS
"-Wno-old-style-cast -Wno-useless-cast"
)
set_source_files_properties(
clipboard.cpp
network.cpp
network_worker.cpp
text.cpp
PROPERTIES
COMPILE_FLAGS "-Wno-old-style-cast")
set_source_files_properties(
text.cpp
PROPERTIES
COMPILE_FLAGS "-Wno-old-style-cast -Wno-useless-cast")
endif(CMAKE_COMPILER_IS_GNUCXX)
########### Helper libraries ###############