Use of BREAK

CachéQuality release 
1.0.0
Id 
OS0070
Rule type 
Severity 

Blocker

Blocker
SQALE characteristic 
  • Reliability
    • Instruction
Tags 
probable-bug, trap
Remediation function 
Constant/issue
Remediation cost 
5min

The BREAK command is normally used in interactive code to suspend the execution of a program at a given point.

This means that it should never be used in non interactive code. You should check that this BREAK invocation is legitimate in this context.

Trap...

People coming from other languages where break exits a loop may be tempted to write, for instance:

    while (1) {
        // some things, then
        if (condition) break
    }

Of course, this will not have the desired effect... The command to "break" out of a loop is actually QUIT!