Core: Sidestep GCC false-positives

(cherry picked from commit acdb8667b5)

Adds some more fixes for 4.5.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
Thaddeus Crews 2025-10-17 15:21:57 -05:00 committed by Rémi Verschelde
parent 1bcfe5dd09
commit 0687d5f29f
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 8 additions and 0 deletions

View file

@ -2336,6 +2336,10 @@ void Image::initialize_data(const char **p_xpm) {
} break;
case READING_PIXELS: {
int y = line - colormap_size - 1;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
#endif
for (int x = 0; x < size_width; x++) {
char pixelstr[6] = { 0, 0, 0, 0, 0, 0 };
for (int i = 0; i < pixelchars; i++) {
@ -2350,6 +2354,9 @@ void Image::initialize_data(const char **p_xpm) {
}
_put_pixelb(x, y, pixel_size, data_write, pixel);
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
if (y == (size_height - 1)) {
status = DONE;

View file

@ -104,6 +104,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
const NodeData *nd = &nodes[0];
Node **ret_nodes = (Node **)alloca(sizeof(Node *) * nc);
ret_nodes[0] = nullptr; // Sidesteps "maybe uninitialized" false-positives on GCC.
bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.is_empty();