Test stricter GCC compiler settings, these warnings will now give errors.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 17 Oct 2010 08:04:28 +0000 (08:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 17 Oct 2010 08:04:28 +0000 (08:04 +0000)
- implicit function declaration.
- no return type set for a function.
- declaration after statement.

This may be too strict but in general I prefer we don't allow commits with these warnings.
Applies to cmake/gcc and scons/linux.

CMakeLists.txt
build_files/scons/config/linux2-config.py

index 53ee69bd3e850606117a025bbd5c1b3202385356..6ed3cd788b68f1d2150f9d2aa48300734453cfde 100644 (file)
@@ -920,10 +920,8 @@ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
 
 #-----------------------------------------------------------------------------
 # Extra compile flags
-
-# TODO: remove this and uncommend the global arg, but for now adding here keeps it managable
 IF(CMAKE_COMPILER_IS_GNUCC)
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-parameter")
+       SET(C_WARNINGS "${C_WARNINGS} -Wunused-parameter -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=return-type")
 ENDIF(CMAKE_COMPILER_IS_GNUCC)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
index f3e0085125a0b33dfc49d3d135232b8653d152dd..fd42e61da0c015bbeeb638061579921d063f2282 100644 (file)
@@ -204,7 +204,7 @@ REL_CCFLAGS = ['-O2']
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']