Skip to content

Commit b8d8e1e

Browse files
authored
Merge pull request #112132 from akien-mga/4.3-fix-gcc-warnings
[4.3] CI: Fix build with latest MinGW-GCC 15
2 parents 1a1be13 + 133780f commit b8d8e1e

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

core/io/image.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,10 @@ void Image::initialize_data(const char **p_xpm) {
23312331
} break;
23322332
case READING_PIXELS: {
23332333
int y = line - colormap_size - 1;
2334+
#if defined(__GNUC__) && !defined(__clang__)
2335+
#pragma GCC diagnostic push
2336+
#pragma GCC diagnostic warning "-Wstringop-overflow=0"
2337+
#endif
23342338
for (int x = 0; x < size_width; x++) {
23352339
char pixelstr[6] = { 0, 0, 0, 0, 0, 0 };
23362340
for (int i = 0; i < pixelchars; i++) {
@@ -2345,6 +2349,9 @@ void Image::initialize_data(const char **p_xpm) {
23452349
}
23462350
_put_pixelb(x, y, pixel_size, data_write, pixel);
23472351
}
2352+
#if defined(__GNUC__) && !defined(__clang__)
2353+
#pragma GCC diagnostic pop
2354+
#endif
23482355

23492356
if (y == (size_height - 1)) {
23502357
status = DONE;

core/math/geometry_2d.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@
3030

3131
#include "geometry_2d.h"
3232

33+
#if defined(__GNUC__) && !defined(__clang__)
34+
#pragma GCC diagnostic push
35+
#pragma GCC diagnostic ignored "-Walloc-zero"
36+
#endif
3337
#include "thirdparty/clipper2/include/clipper2/clipper.h"
38+
#if defined(__GNUC__) && !defined(__clang__)
39+
#pragma GCC diagnostic pop
40+
#endif
3441
#include "thirdparty/misc/polypartition.h"
3542
#define STB_RECT_PACK_IMPLEMENTATION
3643
#include "thirdparty/misc/stb_rect_pack.h"

drivers/wasapi/audio_driver_wasapi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7
8989

9090
#endif // __MINGW32__ || __MINGW64__
9191

92-
#ifndef PKEY_Device_FriendlyName
92+
#ifndef PKEY_Device_FriendlyNameGodot
9393

9494
#undef DEFINE_PROPERTYKEY
9595
/* clang-format off */
9696
#define DEFINE_PROPERTYKEY(id, a, b, c, d, e, f, g, h, i, j, k, l) \
9797
const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l };
9898
/* clang-format on */
9999

100-
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
100+
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameGodot, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
101101
#endif
102102

103103
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
@@ -225,7 +225,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i
225225
PROPVARIANT propvar;
226226
PropVariantInit(&propvar);
227227

228-
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
228+
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
229229
ERR_BREAK(hr != S_OK);
230230

231231
if (p_device->device_name == String(propvar.pwszVal)) {
@@ -588,7 +588,7 @@ PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_input) {
588588
PROPVARIANT propvar;
589589
PropVariantInit(&propvar);
590590

591-
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar);
591+
hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
592592
ERR_BREAK(hr != S_OK);
593593

594594
list.push_back(String(propvar.pwszVal));

scene/resources/packed_scene.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
158158
const NodeData *nd = &nodes[0];
159159

160160
Node **ret_nodes = (Node **)alloca(sizeof(Node *) * nc);
161+
ret_nodes[0] = nullptr; // Sidesteps "maybe uninitialized" false-positives on GCC.
161162

162163
bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.is_empty();
163164

0 commit comments

Comments
 (0)