[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55269] trunk/blender: tweaks to clang so blender can build with -Werror

Campbell Barton ideasman42 at gmail.com
Thu Mar 14 08:25:54 CET 2013


Revision: 55269
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55269
Author:   campbellbarton
Date:     2013-03-14 07:25:54 +0000 (Thu, 14 Mar 2013)
Log Message:
-----------
tweaks to clang so blender can build with -Werror

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/build_files/cmake/macros.cmake
    trunk/blender/intern/opencolorio/ocio_impl.h
    trunk/blender/source/blender/blenlib/intern/math_geom.c

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2013-03-14 07:11:36 UTC (rev 55268)
+++ trunk/blender/CMakeLists.txt	2013-03-14 07:25:54 UTC (rev 55269)
@@ -1992,6 +1992,10 @@
 	# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS      -Wunused-macros)
 	# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS          -Wunused-macros)
 
+	# flags to undo strict flags
+	ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
+	ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS    -Wno-unused-macros)
+
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
 	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)

Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake	2013-03-14 07:11:36 UTC (rev 55268)
+++ trunk/blender/build_files/cmake/macros.cmake	2013-03-14 07:25:54 UTC (rev 55269)
@@ -504,6 +504,9 @@
 		remove_cc_flag("-Wunused-variable")
 		remove_cc_flag("-Werror=[^ ]+")
 		remove_cc_flag("-Werror")
+
+		# negate flags implied by '-Wall'
+		add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
 	endif()
 
 	if(MSVC)

Modified: trunk/blender/intern/opencolorio/ocio_impl.h
===================================================================
--- trunk/blender/intern/opencolorio/ocio_impl.h	2013-03-14 07:11:36 UTC (rev 55268)
+++ trunk/blender/intern/opencolorio/ocio_impl.h	2013-03-14 07:25:54 UTC (rev 55269)
@@ -30,7 +30,7 @@
 
 class IOCIOImpl {
 public:
-	virtual ~IOCIOImpl() {};
+	virtual ~IOCIOImpl() {}
 
 	virtual OCIO_ConstConfigRcPtr *getCurrentConfig(void) = 0;
 	virtual void setCurrentConfig(const OCIO_ConstConfigRcPtr *config) = 0;
@@ -99,7 +99,7 @@
 
 class FallbackImpl : public IOCIOImpl {
 public:
-	FallbackImpl() {};
+	FallbackImpl() {}
 
 	OCIO_ConstConfigRcPtr *getCurrentConfig(void);
 	void setCurrentConfig(const OCIO_ConstConfigRcPtr *config);

Modified: trunk/blender/source/blender/blenlib/intern/math_geom.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_geom.c	2013-03-14 07:11:36 UTC (rev 55268)
+++ trunk/blender/source/blender/blenlib/intern/math_geom.c	2013-03-14 07:25:54 UTC (rev 55269)
@@ -2218,6 +2218,13 @@
 	    len_v2(dirs[3]),
 	};
 
+	/* variable 'area' is just for storage,
+	 * the order its initialized doesn't matter */
+#ifdef __clang__
+#  pragma clang diagnostic push
+#  pragma clang diagnostic ignored "-Wunsequenced"
+#endif
+
 	/* inline mean_value_half_tan four times here */
 	float t[4] = {
 	    MEAN_VALUE_HALF_TAN_V2(area, 0, 1),
@@ -2226,6 +2233,10 @@
 	    MEAN_VALUE_HALF_TAN_V2(area, 3, 0),
 	};
 
+#ifdef __clang__
+#  pragma clang diagnostic pop
+#endif
+
 #undef MEAN_VALUE_HALF_TAN_V2
 
 	w[0] = (t[3] + t[0]) / lens[0];




More information about the Bf-blender-cvs mailing list