I have the following C++ error:

Compiling src/emu/sound.cpp...
../../../../../src/emu/sound.cpp: In member function 'void sound_manager::run_effects()':
../../../../../src/emu/sound.cpp:1001:32: error: 'm_phase' may be used uninitialized in this fu
nction [-Werror=maybe-uninitialized]
 1001 |     si.m_speed_phase = m_phase + (source_sample_index - source_samples);
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../src/emu/sound.cpp:1002:14: error: 'dest_index' may be used uninitialized in this
 function [-Werror=maybe-uninitialized]
 1002 |     eb.commit(dest_index);
      |     ~~~~~~~~~^~~~~~~~~~~~
../../../../../src/emu/sound.cpp:1001:55: error: 'source_sample_index' may be used uninitialize
d in this function [-Werror=maybe-uninitialized]
 1001 |     si.m_speed_phase = m_phase + (source_sample_index - source_samples);
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors
emu.make:1467: recipe for target '../../../../mingw-gcc/obj/x32/Release/src/emu/sound.o' failed

make[2]: *** [../../../../mingw-gcc/obj/x32/Release/src/emu/sound.o] Error 1
makefile:97: recipe for target 'emu' failed
make[1]: *** [emu] Error 2
makefile:1097: recipe for target 'windows_x86' failed
make: *** [windows_x86] Error 2



The C++ source can be taken here: https://github.com/mamedev/mame/blob/master/src/emu/sound.cpp

The function is this here:

void sound_manager::run_effects()
{
	std::unique_lock<std::mutex> dlock(m_effects_data_mutex);
	for(;;) {
		m_effects_condition.wait(dlock);
		if(m_effects_done)
			return;

		std::unique_lock<std::mutex> lock(m_effects_mutex);

		// Copy the data to the effects threads, expanding as need
		// when -speed is in use
		double sf = machine().video().speed_factor();
		if(sf == 1000) {
			for(auto &si : m_speakers) {
				int samples = si.m_buffer.available_samples();
				int channels = si.m_buffer.channels();
				auto &eb = si.m_effects_buffer;
				eb.prepare_space(samples);
				if(m_muted)
					for(int channel = 0; channel != channels; channel ++)
						std::fill(si.m_effects_buffer.ptrw(channel, 0), si.m_effects_buffer.ptrw(channel, 0) + samples, 0);
				else
					for(int channel = 0; channel != channels; channel ++)
						std::copy(si.m_buffer.ptrs(channel, 0), si.m_buffer.ptrs(channel, 0) + samples, eb.ptrw(channel, 0));
				eb.commit(samples);
			}
		} else {
			sf /= 1000;
			for(auto &si : m_speakers) {
				int source_samples = si.m_buffer.available_samples();
				int channels = si.m_buffer.channels();
				auto &eb = si.m_effects_buffer;
				eb.prepare_space(source_samples / sf + 1);
				int source_sample_index;
				int dest_index;
				double m_phase;
				for(int channel = 0; channel != channels; channel ++) {
					const sample_t *src = si.m_buffer.ptrs(channel, 0);
					m_phase = si.m_speed_phase;
					if(m_phase >= 1) {
						source_sample_index = int(m_phase);
						m_phase -= int(m_phase);
					} else
						source_sample_index = 0;
					sample_t *dest = eb.ptrw(channel, 0);
					dest_index = 0;
					while(source_sample_index < source_samples) {
						dest[dest_index++] = m_muted ? 0.0 : src[source_sample_index];
						m_phase += sf;
						if(m_phase >= 1) {
							source_sample_index += int(m_phase);
							m_phase -= int(m_phase);
						}
					}
				}
				si.m_speed_phase = m_phase + (source_sample_index - source_samples);
				eb.commit(dest_index);
			}
		}

		dlock.unlock();

		// Apply the effects
		for(auto &si : m_speakers)
			for(u32 i=0; i != si.m_effects.size(); i++) {
				auto &source = i ? si.m_effects[i-1].m_buffer : si.m_effects_buffer;
				si.m_effects[i].m_effect->apply(source, si.m_effects[i].m_buffer);
				source.sync();
			}

		// Apply the mixing steps
		for(const auto &step : m_output_mixing_steps) {
			if(step.m_mode == mixing_step::CLEAR)
				continue;

			const auto &eb = m_speakers[step.m_device_index].m_effects.back().m_buffer;
			auto &ostream = m_osd_output_streams[step.m_osd_index];
			u32 source_samples = m_speakers[step.m_device_index].m_effects.back().m_buffer.available_samples();

			if(ostream.m_resampler) {
				u64 start_sync = muldiv64(eb.sync_sample(), ostream.m_rate, machine().sample_rate());
				u64 end_sync = muldiv64(eb.sync_sample() + source_samples, ostream.m_rate, machine().sample_rate());
				ostream.m_samples = end_sync - start_sync;
				switch(step.m_mode) {
				case mixing_step::COPY: {
					ostream.m_resampler->apply_copy(eb, ostream.m_buffer, step.m_osd_channel, ostream.m_channels, start_sync, step.m_device_channel, step.m_linear_volume * m_master_gain, ostream.m_samples);
					break;
				}

				case mixing_step::ADD: {
					ostream.m_resampler->apply_add(eb, ostream.m_buffer, step.m_osd_channel, ostream.m_channels, start_sync, step.m_device_channel, step.m_linear_volume * m_master_gain, ostream.m_samples);
					break;
				}
				}

			} else {
				ostream.m_samples = source_samples;
				const sample_t *src = eb.ptrs(step.m_device_channel, 0);
				s16 *dest = ostream.m_buffer.data() + step.m_osd_channel;
				u32 skip = ostream.m_channels;
				switch(step.m_mode) {
				case mixing_step::COPY: {
					float gain = 32768 * step.m_linear_volume * m_master_gain;
					for(u32 sample = 0; sample != source_samples; sample++) {
						*dest = std::clamp(int(*src++ * gain), -32768, 32767);
						dest += skip;
					}
					break;
				}
					
				case mixing_step::ADD: {
					float gain = 32768 * step.m_linear_volume * m_master_gain;
					for(u32 sample = 0; sample != source_samples; sample++) {
						*dest = std::clamp(int(*src++ * gain) + *dest, -32768, 32767);
						dest += skip;
					}
					break;
				}
				}
			}
		}

		for(const auto &step : m_output_mixing_steps)
			if(step.m_mode == mixing_step::CLEAR) {
				auto &ostream = m_osd_output_streams[step.m_osd_index];
				s16 *dest = ostream.m_buffer.data() + step.m_osd_channel;
				u32 skip = ostream.m_channels;
				for(u32 sample = 0; sample != ostream.m_samples; sample++) {
					*dest = 0;
					dest += skip;
				}
			}

		for(auto &si : m_speakers)
			si.m_effects.back().m_buffer.sync();

		// Send the result to the osd
		for(auto &stream : m_osd_output_streams)
			if(stream.m_samples)
				machine().osd().sound_stream_sink_update(stream.m_id, stream.m_buffer.data(), stream.m_samples);

		dlock.lock();
	}
}

How can i fixed it?