Bug 164480 - WebAssembly: Fix -Wreturn-type compiler warnings
Summary: WebAssembly: Fix -Wreturn-type compiler warnings
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-07 06:45 PST by Csaba Osztrogonác
Modified: 2017-03-21 04:10 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.20 KB, patch)
2016-11-07 06:48 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2016-11-07 06:45:52 PST
[1019/1043] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmFormat.cpp.o
../../Source/JavaScriptCore/wasm/WasmFormat.cpp: In function 'const char* JSC::Wasm::toString(JSC::Wasm::Type)':
../../Source/JavaScriptCore/wasm/WasmFormat.cpp:50:1: warning: control reaches end of non-void function [-Wreturn-type]
[1030/1043] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmB3IRGenerator.cpp.o
In file included from ../../Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:44:0:
../../Source/JavaScriptCore/wasm/WasmFunctionParser.h: In member function 'bool JSC::Wasm::FunctionParser<Context>::parseExpression(JSC::Wasm::OpType) [with Context = JSC::Wasm::{anonymous}::B3IRGenerator]':
../../Source/JavaScriptCore/wasm/WasmFunctionParser.h:448:1: warning: control reaches end of non-void function [-Wreturn-type]
[1033/1043] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmValidate.cpp.o
In file included from ../../Source/JavaScriptCore/wasm/WasmValidate.cpp:31:0:
../../Source/JavaScriptCore/wasm/WasmFunctionParser.h: In member function 'bool JSC::Wasm::FunctionParser<Context>::parseExpression(JSC::Wasm::OpType) [with Context = JSC::Wasm::Validate]':
../../Source/JavaScriptCore/wasm/WasmFunctionParser.h:448:1: warning: control reaches end of non-void function [-Wreturn-type]
In file included from ../../Source/JavaScriptCore/wasm/WasmValidate.cpp:369:0:
DerivedSources/JavaScriptCore/WasmValidateInlines.h: In member function 'bool JSC::Wasm::Validate::unaryOp(JSC::Wasm::UnaryOpType, JSC::Wasm::Validate::ExpressionType, JSC::Wasm::Validate::ExpressionType&)':
DerivedSources/JavaScriptCore/WasmValidateInlines.h:481:1: warning: control reaches end of non-void function [-Wreturn-type]
DerivedSources/JavaScriptCore/WasmValidateInlines.h: In member function 'bool JSC::Wasm::Validate::binaryOp(JSC::Wasm::BinaryOpType, JSC::Wasm::Validate::ExpressionType, JSC::Wasm::Validate::ExpressionType, JSC::Wasm::Validate::ExpressionType&)':
DerivedSources/JavaScriptCore/WasmValidateInlines.h:1524:1: warning: control reaches end of non-void function [-Wreturn-type]
DerivedSources/JavaScriptCore/WasmValidateInlines.h: In member function 'bool JSC::Wasm::Validate::load(JSC::Wasm::LoadOpType, JSC::Wasm::Validate::ExpressionType, JSC::Wasm::Validate::ExpressionType&, uint32_t)':
DerivedSources/JavaScriptCore/WasmValidateInlines.h:1657:1: warning: control reaches end of non-void function [-Wreturn-type]
DerivedSources/JavaScriptCore/WasmValidateInlines.h: In member function 'bool JSC::Wasm::Validate::store(JSC::Wasm::StoreOpType, JSC::Wasm::Validate::ExpressionType, JSC::Wasm::Validate::ExpressionType, uint32_t)':
DerivedSources/JavaScriptCore/WasmValidateInlines.h:1781:1: warning: control reaches end of non-void function [-Wreturn-type]

We should use RELEASE_ASSERT_NOT_REACHED() to avoid these warnings and undefined behaviour due to missing return at the end of the functions.
Comment 1 Csaba Osztrogonác 2016-11-07 06:48:00 PST
Created attachment 294060 [details]
Patch
Comment 2 Keith Miller 2016-11-07 08:48:53 PST
Comment on attachment 294060 [details]
Patch

r=me.
Comment 3 Michael Catanzaro 2017-03-06 18:44:39 PST
Ossy?
Comment 4 Csaba Osztrogonác 2017-03-06 21:42:33 PST
(In reply to comment #3)
> Ossy?

Thanks for the reminder, I completely missed this bug. I'll check and land it soon if it is still valid.
Comment 5 Csaba Osztrogonác 2017-03-21 04:10:23 PDT
I haven't seen any warning now, and these files changed a lot since then.