make gcc warn about signed/unsigned comparisons, just like Visual Studio does

This commit is contained in:
Enno Rehling 2015-05-16 22:35:07 +02:00
parent 1dc516ab50
commit 9418051cd3
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ 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)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -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} -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} /W4 /WX /MP") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /WX /MP")

View File

@ -1199,7 +1199,7 @@ void setguard(unit * u, unsigned int flags)
} }
fset(u, UFL_GUARD); fset(u, UFL_GUARD);
fset(u->region, RF_GUARDED); fset(u->region, RF_GUARDED);
if ((int)flags == guard_flags(u)) { if (flags == guard_flags(u)) {
if (a) if (a)
a_remove(&u->attribs, a); a_remove(&u->attribs, a);
} }