Let's catch enforced compiler errors during compilation
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
# Project Definition
project(odhcp6c C)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
-add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -pedantic)
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -std=c99")
+add_definitions(-D_GNU_SOURCE -Os -Wall -Werror -pedantic)
+IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
+ add_definitions(-Wextra -Werror=implicit-function-declaration)
+ add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral)
+ENDIF()
+add_definitions(-Wno-unused-parameter -Wmissing-declarations)
if(${EXT_PREFIX_CLASS})
add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})