There was a warning that advises you that maybe you are messing up with concatenated conditions without parenthesis, and that is precisely what is going on with boundaries. In fact, the compiler is right and it is evaluating badly. Is on line 260 aprox on Boundary.hpp file.
The code below is the problematic one:
Protections::FaultType check_bounds()override{
if(*src < lower_boundary || *src > upper_boundary) return Protections::FAULT;
if(has_warning_level && *src < lower_boundary || *src > upper_boundary){
return Protections::WARNING;
}
return Protections::OK;
}
It can be fixed this way:
Protections::FaultType check_bounds()override{
if(has_warning_level && (*src < lower_boundary || *src > upper_boundary)){
return Protections::WARNING;
}
if(*src < lower_boundary || *src > upper_boundary) return Protections::FAULT;
return Protections::OK;
}
There was a warning that advises you that maybe you are messing up with concatenated conditions without parenthesis, and that is precisely what is going on with boundaries. In fact, the compiler is right and it is evaluating badly. Is on line 260 aprox on
Boundary.hppfile.The code below is the problematic one:
It can be fixed this way: