diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-09 09:25:34 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-09 09:25:34 +0000 |
commit | b14b763f1fd43a15ebafaeedf8b520849d7459a5 (patch) | |
tree | 235b8b6256cd629d05ae13903460b2c1e44f7f37 /gcc/c-parse.in | |
parent | 33126533ba216e3170b11497a036d6514a45228e (diff) | |
download | gcc-b14b763f1fd43a15ebafaeedf8b520849d7459a5.tar.gz |
* c-parse.in (if_stmt_locus): New object.
(if_prefix rule): Use it. Don't use warning_with_file_and_line.
(select_or_iter_stmt rule): Likewise.
(if_stmt_file): Remove.
(if_stmt_line): Likewise.
* jump.c: include "diagnostic.h"
(never_reached_warning): Don't use warning_with_file_and_line.
* Makefile.in (jump.o): Add dependce on diagnostic.h
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66627 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 807f90a9048..f9d3656662d 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -261,10 +261,10 @@ end ifobjc static int stmt_count; static int compstmt_count; -/* Input file and line number of the end of the body of last simple_if; +/* Input location of the end of the body of last simple_if; used by the stmt-rule immediately after simple_if returns. */ -static const char *if_stmt_file; -static int if_stmt_line; +static location_t if_stmt_locus; + /* List of types and structure classes of the current declaration. */ static GTY(()) tree current_declspecs; @@ -2215,8 +2215,8 @@ if_prefix: { c_expand_start_cond (c_common_truthvalue_conversion ($4), compstmt_count,$<ttype>2); $<itype>$ = stmt_count; - if_stmt_file = $<filename>-2; - if_stmt_line = $<lineno>-1; } + if_stmt_locus.file = $<filename>-2; + if_stmt_locus.line = $<lineno>-1; } ; /* This is a subroutine of stmt. @@ -2305,8 +2305,8 @@ select_or_iter_stmt: 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"); } + warning ("%Hempty body in an if-statement", + &if_stmt_locus); } /* Make sure c_expand_end_cond is run once for each call to c_expand_start_cond. Otherwise a crash is likely. */ |