From 1f8034524291de95f4328f79e6d60d2194cbd7a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Sep 2025 21:48:43 +1000 Subject: [PATCH] Cleanup: quiet some array-bounds warnings with GCC 15 Warnings remain but suppression is not as simple, see: !146150. --- source/blender/blenlib/BLI_array.hh | 7 +++++++ .../editors/space_sequencer/sequencer_preview_draw.cc | 4 ++-- source/blender/modifiers/intern/MOD_particleinstance.cc | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/BLI_array.hh b/source/blender/blenlib/BLI_array.hh index e7f2ac2dc43..2f1ee97155c 100644 --- a/source/blender/blenlib/BLI_array.hh +++ b/source/blender/blenlib/BLI_array.hh @@ -133,7 +133,14 @@ class Array { { BLI_assert(size >= 0); data_ = this->get_buffer_for_size(size); +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif uninitialized_fill_n(data_, size, value); +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic pop +#endif size_ = size; } diff --git a/source/blender/editors/space_sequencer/sequencer_preview_draw.cc b/source/blender/editors/space_sequencer/sequencer_preview_draw.cc index e24eef99b94..e89f47bc141 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview_draw.cc +++ b/source/blender/editors/space_sequencer/sequencer_preview_draw.cc @@ -1101,7 +1101,7 @@ static void text_selection_draw(const bContext *C, const Strip *strip, uint pos) const blender::float2 view_offs{-scene->r.xsch / 2.0f, -scene->r.ysch / 2.0f}; const float view_aspect = scene->r.xasp / scene->r.yasp; blender::float3x3 transform_mat = seq::image_transform_matrix_get(scene, strip); - blender::float4x2 selection_quad{ + blender::float2 selection_quad[4] = { {character_start.position.x, line_y}, {character_start.position.x, line_y + text->line_height}, {character_end.position.x + character_end.advance_x, line_y + text->line_height}, @@ -1160,7 +1160,7 @@ static void text_edit_draw_cursor(const bContext *C, const Strip *strip, uint po cursor_coords = coords_region_view_align(UI_view2d_fromcontext(C), cursor_coords); - blender::float4x2 cursor_quad{ + blender::float2 cursor_quad[4] = { {cursor_coords.x, cursor_coords.y}, {cursor_coords.x, cursor_coords.y + text->line_height}, {cursor_coords.x + cursor_width, cursor_coords.y + text->line_height}, diff --git a/source/blender/modifiers/intern/MOD_particleinstance.cc b/source/blender/modifiers/intern/MOD_particleinstance.cc index 80c68dd3fa9..af7e271f5f2 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.cc +++ b/source/blender/modifiers/intern/MOD_particleinstance.cc @@ -197,7 +197,8 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh int totvert, faces_num, totloop, totedge; int maxvert, maxpoly, maxloop, maxedge, part_end = 0, part_start; int k, p, p_skip; - short track = ctx->object->trackflag % 3, trackneg, axis = pimd->axis; + const uint track = uint(ctx->object->trackflag) % 3; + short trackneg, axis = pimd->axis; float max_co = 0.0, min_co = 0.0, temp_co[3]; float *size = nullptr; float spacemat[4][4];