FreeBSD/contrib/gcc/c-common.c
/* Print a warning about if (); or if () .. else; constructs
   via the special empty statement node that we create.  INNER_THEN
   and INNER_ELSE are the statement lists of the if and the else
   block.  */
Print a warning about if (); or if () .. else; constructs
via the special empty statement node that we create.  INNER_THEN
and INNER_ELSE are the statement lists of the if and the else
block.
Print a warning about if () ; or if () .. else ; constructs via the special empty statement node that we create . INNER_THEN and INNER_ELSE are the statement lists of the if and the else block .
void
empty_body_warning (tree inner_then, tree inner_else)
{
  if (extra_warnings)
    {
      if (TREE_CODE (inner_then) == STATEMENT_LIST
	  && STATEMENT_LIST_TAIL (inner_then))
	inner_then = STATEMENT_LIST_TAIL (inner_then)->stmt;
      if (inner_else && TREE_CODE (inner_else) == STATEMENT_LIST
	  && STATEMENT_LIST_TAIL (inner_else))
	inner_else = STATEMENT_LIST_TAIL (inner_else)->stmt;
      if (IS_EMPTY_STMT (inner_then) && !inner_else)
	warning (OPT_Wextra, "%Hempty body in an if-statement",
		 EXPR_LOCUS (inner_then));
      if (inner_else && IS_EMPTY_STMT (inner_else))
	warning (OPT_Wextra, "%Hempty body in an else-statement",
		 EXPR_LOCUS (inner_else));
   }
}
void empty_body_warning ( tree inner_then , tree inner_else ) { if ( extra_warnings ) { if ( TREE_CODE ( inner_then ) == STATEMENT_LIST && STATEMENT_LIST_TAIL ( inner_then ) ) inner_then = STATEMENT_LIST_TAIL ( inner_then ) -> stmt ; if ( inner_else && TREE_CODE ( inner_else ) == STATEMENT_LIST && STATEMENT_LIST_TAIL ( inner_else ) ) inner_else = STATEMENT_LIST_TAIL ( inner_else ) -> stmt ; if ( IS_EMPTY_STMT ( inner_then ) && ! inner_else ) warning ( OPT_Wextra , " " , EXPR_LOCUS ( inner_then ) ) ; if ( inner_else && IS_EMPTY_STMT ( inner_else ) ) warning ( OPT_Wextra , " " , EXPR_LOCUS ( inner_else ) ) ; } }
Print a warning about if (); or if () .. else; constructs
via the special empty statement node that we create.
Print a warning about if () ; or if () .. else ; constructs via the special empty statement node that we create .