From 218d0f8a84f4f3df355a5eeaffc7bca059c672d6 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 11 Jul 1994 18:17:57 -0400 Subject: [PATCH] (stmt): Don't give more than one error message if a nested `if' has an empty body. From-SVN: r7722 --- gcc/c-parse.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/c-parse.in b/gcc/c-parse.in index c6403e56a5b..bf3183bbcdb 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -1680,8 +1680,9 @@ stmt: { expand_end_cond (); /* This warning is here instead of in simple_if, because we do not want a warning if an empty if is followed by an - else statement. */ - if (extra_warnings && stmt_count == $1) + else statement. Increment stmt_count so we don't + give a second error if this is a nested `if'. */ + if (extra_warnings && stmt_count++ == $1) warning_with_file_and_line (if_stmt_file, if_stmt_line, "empty body in an if-statement"); } /* Make sure expand_end_cond is run once