enable warning for unused args with gcc: -Wunused-parameter
authorCampbell Barton <ideasman42@gmail.com>
Fri, 15 Oct 2010 02:24:48 +0000 (02:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 15 Oct 2010 02:24:48 +0000 (02:24 +0000)
- for cmake only apply this to source/blender, will apply globally later.
- ./extern/ ./source/blender/makesrna/intern/ ignore this.

CMakeLists.txt
build_files/scons/config/linux2-config.py
extern/CMakeLists.txt
source/blender/CMakeLists.txt
source/blender/makesrna/intern/CMakeLists.txt

index 67dd7e4010072546ab6025696a8275bfc35abc71..46977d780f63b06909b14c828e9a229f3d5fcd9f 100644 (file)
@@ -318,6 +318,7 @@ IF(UNIX AND NOT APPLE)
        SET(PLATFORM_LINKFLAGS "-pthread")
 
        # Better warnings
+       # note: -Wunused-parameter should be added but for now only apply to ./source/blender
        SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas")
        SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
 
index a9c74d692d78f5f869346aa7f55cd682be85e642..f3e0085125a0b33dfc49d3d135232b8653d152dd 100644 (file)
@@ -204,7 +204,7 @@ REL_CCFLAGS = ['-O2']
 ##ARFLAGS = ruv
 ##ARFLAGSQUIET = ru
 ##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
+C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter']
 CC_WARN = ['-Wall']
 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 
index b15c8a31c730a15eb706770a1de3e8176ec83dcf..61acff4cfe42d24a108c2813c55c1625c75f132a 100644 (file)
@@ -24,6 +24,9 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+# Otherwise we get warnings here that we cant fix in external projects
+STRING(REGEX REPLACE "-Wunused-parameter" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+
 IF(WITH_BULLET)
        ADD_SUBDIRECTORY(bullet2)
 ENDIF(WITH_BULLET)
index 96d1ce3e8b21bfd5fac8893f0071d88e84203d12..dc0640c817f557e58bc451847dd1f9d6074bf69e 100644 (file)
 #
 # ***** END GPL LICENSE BLOCK *****
 
+# 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")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
 ADD_SUBDIRECTORY(windowmanager)
 ADD_SUBDIRECTORY(editors)
 ADD_SUBDIRECTORY(avi)
index 4f9032ffc951d7092e11658d360d08f59acab58a..a48603e623c54a985a6382154302eb95a99d82c0 100644 (file)
@@ -24,6 +24,9 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+# this warning on generated files gets annoying
+STRING(REGEX REPLACE "-Wunused-parameter" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+
 FILE(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
 FILE(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c")
 LIST(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)