Cevelop / cevelop

The C++ IDE for professional developers
Eclipse Public License 2.0
6 stars 0 forks source link

GLSAtor: Implement ES.86 - Avoid modifying loop control variables inside the body of raw for-loops #18

Open fmorgner opened 6 years ago

fmorgner commented 6 years ago

Expected Behavior

CCGLator/GSLator should warn from possibly undesired effects in code such as this:

void fun() {
  for(int i = 0; i < 42; ++i) {
    if(some_weird_condition) {
      --i;
    }
  }
}

Actual Behavior

No warning is issued, since there are no checks in place.

Cevelop Version, Operating System and Compiler

Cevelop 1.9.1 with current beta plugins.

PeterSommerlad commented 6 years ago

I am sure there is a MISRA/AUTOSAR rule about such multiple changes of a loop index. Need to look it up