diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-11 22:17:57 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-07-11 22:17:57 +0000 |
commit | 26bbcd163cdafc16b48e868115af7081796081ef (patch) | |
tree | fc78491bd560f78e9f092e99d76ee7f6d75d7843 /gcc/c-parse.in | |
parent | a27c5e9e219ccb12d5997ec9c5f6f7faf2885857 (diff) | |
download | gcc-26bbcd163cdafc16b48e868115af7081796081ef.tar.gz |
(stmt): Don't give more than one error message if a nested `if' has an
empty body.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 5 |
1 files 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 == $<itype>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++ == $<itype>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 |