| Summary: | -Wreturn-type warning in BaseAudioContext.cpp | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||
| Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bugs-noreply, cdumez, darin, eric.carlson, ews-watchlist, glenn, jer.noble, mcatanzaro, philipj, sergio | ||||
| Priority: | P2 | ||||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Attachments: |
|
||||||
Created attachment 408084 [details]
Patch
Committed r266661: <https://trac.webkit.org/changeset/266661> All reviewed patches have been landed. Closing bug and clearing flags on attachment 408084 [details]. |
[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().