Fixes segfault / infinite loop with OpenAL and anything higher than -O1 mostly due to missing return values. https://bugs.gentoo.org/703384 https://bugs.gentoo.org/703386 https://bugs.gentoo.org/729002 https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 --- a/g_src/enabler.cpp +++ b/g_src/enabler.cpp @@ -592,6 +592,8 @@ int enablerst::loop(string cmdline) { // Clean up graphical resources delete renderer; + + return 0; } void enablerst::override_grid_size(int x, int y) { --- a/g_src/music_and_sound_openal.cpp +++ b/g_src/music_and_sound_openal.cpp @@ -250,7 +250,6 @@ void musicsoundst::deinitsound() { alDeleteBuffers(1, &buffer); } // Deinit OpenAL - alcMakeContextCurrent(NULL); alcDestroyContext(context); alcCloseDevice(device); @@ -480,7 +479,7 @@ static bool init_openal() { void alEnable( ALenum capability ) { _alEnable(capability); } void alDisable( ALenum capability ) { _alDisable(capability); } -ALboolean alIsEnabled( ALenum capability ) { _alIsEnabled(capability); } +ALboolean alIsEnabled( ALenum capability ) { return _alIsEnabled(capability); } const ALchar* alGetString( ALenum param ) { return _alGetString(param); } void alGetBooleanv( ALenum param, ALboolean* data ) { _alGetBooleanv(param, data); } void alGetIntegerv( ALenum param, ALint* data ) { _alGetIntegerv(param, data); } @@ -490,7 +489,7 @@ ALboolean alGetBoolean( ALenum param ) { return _alGetBoolean(param); } ALint alGetInteger( ALenum param ) { return _alGetInteger(param); } ALfloat alGetFloat( ALenum param ) { return _alGetFloat(param); } ALdouble alGetDouble( ALenum param ) { return _alGetDouble(param); } -ALenum alGetError( void ) { _alGetError(); } +ALenum alGetError( void ) { return _alGetError(); } ALboolean alIsExtensionPresent( const ALchar* extname ) { return _alIsExtensionPresent(extname); } void* alGetProcAddress( const ALchar* fname ) { return _alGetProcAddress(fname); } ALenum alGetEnumValue( const ALchar* ename ) { return _alGetEnumValue(ename); }