[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32533] trunk/blender: Test stricter GCC compiler settings, these warnings will now give errors.
Campbell Barton
ideasman42 at gmail.com
Sun Oct 17 10:04:28 CEST 2010
Revision: 32533
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32533
Author: campbellbarton
Date: 2010-10-17 10:04:28 +0200 (Sun, 17 Oct 2010)
Log Message:
-----------
Test stricter GCC compiler settings, these warnings will now give errors.
- 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.
Modified Paths:
--------------
trunk/blender/CMakeLists.txt
trunk/blender/build_files/scons/config/linux2-config.py
Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt 2010-10-17 06:38:56 UTC (rev 32532)
+++ trunk/blender/CMakeLists.txt 2010-10-17 08:04:28 UTC (rev 32533)
@@ -920,10 +920,8 @@
#-----------------------------------------------------------------------------
# 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}")
Modified: trunk/blender/build_files/scons/config/linux2-config.py
===================================================================
--- trunk/blender/build_files/scons/config/linux2-config.py 2010-10-17 06:38:56 UTC (rev 32532)
+++ trunk/blender/build_files/scons/config/linux2-config.py 2010-10-17 08:04:28 UTC (rev 32533)
@@ -204,7 +204,7 @@
##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']
More information about the Bf-blender-cvs
mailing list