MISRA.STMT.COND.NOT_BOOLEANCondition of if or loop statement is not a boolean expression. MISRA-C++ Rule 5-0-13 (required): The condition of an if-statement and the condition of an iteration-statement shall have type bool.RationaleIf an expression with type other than bool is used in the condition of an if-statement or iteration-statement, then its result will be implicitly converted to bool. The condition expression shall contain an explicit test (yielding a result of type bool) in order to clarify the intentions of the developer. ExceptionA condition of the form type-specifier-seq declarator is not required to have type bool. This exception is introduced because alternative mechanisms for achieving the same effect are cumbersome and error-prone. Exampleextern int32_t * fn ( ); extern int32_t fn2 ( ); extern bool fn3 ( ); while ( int32_t * p = fn ( ) ) // Compliant by exception { // Code } // The following is a cumbersome but compliant example do { int32_t * p = fn ( ); if ( NULL == p ) { break; } // Code... } while ( true ); // Compliant while ( int32_t length = fn2 ( ) ) // Compliant by exception { // Code } while ( bool flag = fn3 ( ) ) // Compliant { // Code } if ( int32_t * p = fn ( ) ) // Compliant by exception if ( int32_t length = fn2 ( ) ) // Compliant by exception if ( bool flag = fn3 ( ) ) // Compliant if ( u8 ) // Non-compliant if ( u8 && ( bool_1 <= bool_2 ) ) // Non-compliant for ( int32_t x = 10; x; --x ) // Non-compliant |