Repository: godotengine/godot (language: cpp)

Issue:
Compilation warning `-Wstringop-overflow=` in `audio_effect_pitch_shift.cpp` with mingw-gcc
### Tested versions

- Git commit hash aa65940a8509fb880e2c666eb8a901525d9200ff

### System information

Windows 11 - MinGW

### Issue description

I encountered a compilation error when building the Godot Engine from source using scons on Windows with the mingw compiler. The error occurs in audio_effect_pitch_shift.cpp, specifically due to a memset operation that exceeds the maximum object size.


### Steps to reproduce

Clone the Godot Engine source code repository.

Run the following command to compile:

```
scons platform=windows use_mingw=yes dev_mode=yes
```

Observed Output:

The compilation fails with the following error:
```
ERROR: servers\audio\effects\audio_effect_pitch_shift.cpp: In member function 'void SMBPitchShift::PitchShift(float, long int, long int, long int, float, float*, float*, int)':
servers\audio\effects\audio_effect_pitch_shift.cpp:163:31: error: 'void* memset(void*, int, size_t)' specified bound between 18446744065119617024 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  163 |                         memset(gSynMagn, 0, fftFrameSize*sizeof(float));
      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
servers\audio\effects\audio_effect_pitch_shift.cpp:164:31: error: 'void* memset(void*, int, size_t)' specified bound between 18446744065119617024 and 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
  164 |                         memset(gSynFreq, 0, fftFrameSize*sizeof(float));
      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors
```

System Information:

OS: Windows 11

Compiler: MinGW

Please let me know if further information or logs are needed to assist in diagnosing this problem.

### Minimal reproduction project (MRP)

N/A


Discussion / hints:
Note that this is only a warning, but it's treated as error because `dev_mode=yes` enables `werror=yes`, i.e. treating warnings as errors.

I've actually reported this a while ago in #88504 already, and attempted to fix it twice with #88509 and then #88658, but it's elusive and seems to keep coming back...
Could you test if this fixes the warning?
```diff
diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h
index 949ce96057..381833c24a 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.h
+++ b/servers/audio/effects/audio_effect_pitch_shift.h
@@ -77,7 +77,7 @@ class AudioEffectPitchShift : public AudioEffect {
 public:
 	friend class AudioEffectPitchShiftInstance;
 
-	enum FFTSize {
+	enum FFTSize : unsigned int {
 		FFT_SIZE_256,
 		FFT_SIZE_512,
 		FFT_SIZE_1024,
```
It works, thanks.

Fix patch:
diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h
index 949ce9605795..381833c24aea 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.h
+++ b/servers/audio/effects/audio_effect_pitch_shift.h
@@ -77,7 +77,7 @@ class AudioEffectPitchShift : public AudioEffect {
 public:
 	friend class AudioEffectPitchShiftInstance;
 
-	enum FFTSize {
+	enum FFTSize : unsigned int {
 		FFT_SIZE_256,
 		FFT_SIZE_512,
 		FFT_SIZE_1024,


Test patch: