mardi 23 juillet 2019

C++ Crash on a non-void function doesn't have return statement

I got a crash when a non void function like this didn't return anything:

bool ClassA::foo() {
    //---do something---
}

void ClassA::foo2() {
   foo();
}

Please note that the return value of this function was not used. And the crash is 100% reproducible. It crashes every-time. Ideally it should produce a warning and if I am not using the return value, it shouldn't crash.

This C++ code is compiled on Android NDK-version r19.

Also same code was working fine on NDK-r15c.

Is there any latest change?

Aucun commentaire:

Enregistrer un commentaire