11-12-2015, 12:08 AM
Would the following examples be compliant with rule #15.7?
Would the following examples be compliant with rule #15.7?
Would the following examples be non-compliant with rule #15.7?
Code:
void R_15_7 ( void ) {
bool_t flag_1 = get_bool ( );
bool_t flag_2 = get_bool ( );
if ( flag_1 ) {
action_f1 ( );
}
else if ( flag_2 ) {
action_f2 ( );
}
else { // here , is the "else" compliant ?
persistent_side_effects();
}
}
Would the following examples be compliant with rule #15.7?
Code:
void R_15_7 ( void ) {
bool_t flag_1 = get_bool ( );
bool_t flag_2 = get_bool ( );
if ( flag_1 ) {
action_f1 ( );
}
else if ( flag_2 ) {
action_f2 ( );
}
else { // here , is the "else" compliant ?
side_effects();
}
}
Would the following examples be non-compliant with rule #15.7?
Code:
void R_15_7 ( void ) {
bool_t flag_1 = get_bool ( );
bool_t flag_2 = get_bool ( );
if ( flag_1 ) {
action_f1 ( );
}
else if ( flag_2 ) {
action_f2 ( );
}
else { // here, is the "else" non-compliant ?
no_side_effects();
}
}
<t></t>