CMake: enable comma-subscript GCC warning

This commit is contained in:
Campbell Barton 2023-08-17 23:13:41 +10:00
parent 110cb5d0d5
commit b6c014c731
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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_) \
{ \