6

Uncrustify を使用して、ネストされた If-else にブレースを追加する方法があるかどうか疑問に思っていました。例えば:

if( stat_error == -1 ){
   if ( debug > 0 )
      printf( "...ERROR ); //I would like to add braces around here.
   exit( -1 );
} else {

私はこれを見ました:

# Add or remove braces on single-line 'if' statement. Will not remove the braces if they contain an 'else'.
mod_full_brace_if                        = add   # ignore/add/remove/force

しかし、ネストされた条件文では機能しないようです。

それを行う方法はありますか?

4

2 に答える 2

-4

次のようなreturnステートメントを追加する必要があります

    if( stat_error == -1 ){
   if ( debug > 0 )
      printf( "...ERROR ); //I would like to add braces around here.
   exit( -1 );
} else{

Insert else statement
}
return statement here
}
于 2013-12-02T16:30:05.783 に答える