RESOLVED FIXED 216215
-Wreturn-type warning in BaseAudioContext.cpp
https://bugs.webkit.org/show_bug.cgi?id=216215
Summary -Wreturn-type warning in BaseAudioContext.cpp
Michael Catanzaro
Reported 2020-09-05 07:07:11 PDT
[2556/3671] Building CXX object Source...ources/UnifiedSource-4babe430-24.cpp.o In file included from DerivedSources/WebCore/unified-sources/UnifiedSource-4babe430-24.cpp:3: ../../Source/WebCore/Modules/webaudio/BaseAudioContext.cpp: In member function ‘WebCore::PeriodicWave& WebCore::BaseAudioContext::periodicWave(WebCore::OscillatorType)’: ../../Source/WebCore/Modules/webaudio/BaseAudioContext.cpp:1328:1: warning: control reaches end of non-void function [-Wreturn-type] 1328 | } | ^ For the past several years, I've been fixing this with RELEASE_ASSERT_NOT_REACHED(). The other alternative would be to CRASH(). In this case, we also have an awkward construction: case OscillatorType::Custom: ASSERT_NOT_REACHED(); #ifdef NDEBUG FALLTHROUGH; #endif Which appears to be an attempt to avoid performance penalty form RELEASE_ASSERT_NOT_REACHED(). It's simpler and safer to just use RELEASE_ASSERT_NOT_REACHED().
Attachments
Patch (1.63 KB, patch)
2020-09-05 07:11 PDT, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2020-09-05 07:11:22 PDT
EWS
Comment 2 2020-09-05 08:57:40 PDT
Committed r266661: <https://trac.webkit.org/changeset/266661> All reviewed patches have been landed. Closing bug and clearing flags on attachment 408084 [details].
Note You need to log in before you can comment on or make changes to this bug.