diff --git a/CMakeLists.txt b/CMakeLists.txt index 9574a9c66f6..e15a8ac4a03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1739,6 +1739,7 @@ if(CMAKE_COMPILER_IS_GNUCC) CXX_WARN_UNUSED_PARAMETER -Wunused-parameter CXX_WARN_WRITE_STRINGS -Wwrite-strings CXX_WARN_UNDEF -Wundef + CXX_WARN_COMMA_SUBSCRIPT -Wcomma-subscript CXX_WARN_FORMAT_SIGN -Wformat-signedness CXX_WARN_RESTRICT -Wrestrict CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h index e6942281de9..a3e910af79b 100644 --- a/source/blender/blenlib/BLI_buffer.h +++ b/source/blender/blenlib/BLI_buffer.h @@ -37,9 +37,9 @@ enum { #define BLI_buffer_at(buffer_, type_, index_) \ ((((type_ *)(buffer_) \ - ->data)[(BLI_assert(sizeof(type_) == (buffer_)->elem_size)), \ - (BLI_assert((int)(index_) >= 0 && (size_t)(index_) < (buffer_)->count)), \ - index_])) + ->data)[((BLI_assert(sizeof(type_) == (buffer_)->elem_size)), \ + (BLI_assert((int)(index_) >= 0 && (size_t)(index_) < (buffer_)->count)), \ + index_)])) #define BLI_buffer_array(buffer_, type_) (&(BLI_buffer_at(buffer_, type_, 0))) @@ -50,8 +50,8 @@ enum { ((BLI_buffer_reinit(buffer_, new_count_), new_count_ ? BLI_buffer_array(buffer_, type_) : NULL)) #define BLI_buffer_append(buffer_, type_, val_) \ - (BLI_buffer_resize(buffer_, (buffer_)->count + 1), \ - (BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_)) + ((BLI_buffer_resize(buffer_, (buffer_)->count + 1), \ + (BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_))) #define BLI_buffer_clear(buffer_) \ { \