tweaks to clang so blender can build with -Werror

This commit is contained in:
Campbell Barton 2013-03-14 07:25:54 +00:00
parent 21dc93d275
commit 6a51379bf7
4 changed files with 20 additions and 2 deletions

@ -1992,6 +1992,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# 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)

@ -504,6 +504,9 @@ macro(remove_strict_flags)
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)

@ -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 @@ public:
class FallbackImpl : public IOCIOImpl {
public:
FallbackImpl() {};
FallbackImpl() {}
OCIO_ConstConfigRcPtr *getCurrentConfig(void);
void setCurrentConfig(const OCIO_ConstConfigRcPtr *config);

@ -2218,6 +2218,13 @@ void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const flo
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 @@ void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const flo
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];