Closed cyrilbouvier closed 3 years ago
Cyril OK; I'll do the changes. I guess returning dummy values is enough (as error 'default' cases should not be reachable). Surprisingly, I never saw these warnings. Did you compile ibex in a specific way?
I am compiling with gcc 8.3 and flags -O3 -DNDEBUG
.
I think it is ok now, can you confirm and close the ticket?
I confirm that the warning is gone and there is no more undefined behavior.
As pointed by the compiler, the method
ExprNode::accept_visitor
must return a value, but, in some cases, do not. For example, if the 'default' case is reached and asserts are disabled (they are disabled by CMake and waf if not in debug compile mode).From https://en.cppreference.com/w/cpp/language/return:
Undefined behavior are dangerous, because, even if the problematic portion of the code cannot be reached and is never reached, the compiler may do whatever it wants with it (like compiling the function to an empty function), see https://en.cppreference.com/w/cpp/language/ub.