Skip to content

warning: non-void function does not return a value in all control paths [-Wreturn-type] } #20

Description

@kalwalt

The shown errror occur in the matrix_t class

emscripten::val getData() const {
if (type == Types::U8_t) {
emscripten::val view{emscripten::typed_memory_view(u8.size(), u8.data())};
auto result = emscripten::val::global("Uint8Array").new_(u8.size());
result.call<void>("set", view);
return view;
} else if (type == Types::S32_t) {
emscripten::val view{
emscripten::typed_memory_view(i32.size(), i32.data())};
auto result = emscripten::val::global("Int32Array").new_(i32.size());
result.call<void>("set", view);
return view;
} else if (type == Types::F32_t) {
emscripten::val view{
emscripten::typed_memory_view(f32.size(), f32.data())};
auto result = emscripten::val::global("Float32Array").new_(f32.size());
result.call<void>("set", view);
return view;
} else if (type == Types::F64_t) {
emscripten::val view{
emscripten::typed_memory_view(f64.size(), f64.data())};
auto result = emscripten::val::global("Float64Array").new_(f64.size());
result.call<void>("set", view);
return view;
}
}

because the return view is not at the end of the statement. This should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions