forked from github/server
Merge pull request #217 from badgerman/develop
enable clang warning for tautological comparisons
This commit is contained in:
commit
c90496e60b
|
@ -12,26 +12,31 @@ include_directories (${LUA_INCLUDE_DIR})
|
||||||
include_directories (${BSON_INCLUDE_DIR})
|
include_directories (${BSON_INCLUDE_DIR})
|
||||||
include_directories (${INIPARSER_INCLUDE_DIR})
|
include_directories (${INIPARSER_INCLUDE_DIR})
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
|
||||||
OUTPUT_VARIABLE GCC_VERSION)
|
|
||||||
if (GCC_VERSION VERSION_GREATER 4.9)
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfloat-conversion")
|
|
||||||
endif()
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion")
|
||||||
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
||||||
elseif(MSVC)
|
ELSEIF(MSVC)
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /MP")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||||
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib")
|
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||||
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
|
||||||
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
ELSE()
|
||||||
MESSAGE(STATUS "Unknown compiler ${CMAKE_C_COMPILER_ID}")
|
MESSAGE(STATUS "unknown compiler ${CMAKE_C_COMPILER_ID}")
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_COMPILER_IS_CLANG)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtautological-compare -Weverything")
|
||||||
|
MESSAGE(STATUS "compiler is clang: ${CMAKE_C_COMPILER_ID}")
|
||||||
|
ELSEIF(CMAKE_COMPILER_IS_GCC)
|
||||||
|
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||||
|
OUTPUT_VARIABLE GCC_VERSION)
|
||||||
|
IF (GCC_VERSION VERSION_GREATER 4.9)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfloat-conversion")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_CLANG)
|
||||||
|
|
||||||
add_subdirectory(util)
|
add_subdirectory(util)
|
||||||
add_subdirectory(kernel)
|
add_subdirectory(kernel)
|
||||||
|
|
|
@ -282,7 +282,6 @@ int main(int argc, char **argv)
|
||||||
int err = 0;
|
int err = 0;
|
||||||
lua_State *L;
|
lua_State *L;
|
||||||
setup_signal_handler();
|
setup_signal_handler();
|
||||||
|
|
||||||
/* parse args once to read config file location */
|
/* parse args once to read config file location */
|
||||||
if (parse_args(argc, argv, &err) != 0) {
|
if (parse_args(argc, argv, &err) != 0) {
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in New Issue