Commit 6ad79f1b by Kaveh R. Ghazi Committed by Kaveh Ghazi

c-decl.c (define_label): Call warning_with_file_and_line and…

c-decl.c (define_label): Call warning_with_file_and_line and error_with_file_and_line instead of plain...

	* c-decl.c (define_label): Call warning_with_file_and_line and
	error_with_file_and_line instead of plain warning or error.

	* c-parse.in (label): Use save_filename/save_lineno to ensure
	correct values for calls to define_label.

From-SVN: r36040
parent c00f0fb2
2000-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-decl.c (define_label): Call warning_with_file_and_line and
error_with_file_and_line instead of plain warning or error.
* c-parse.in (label): Use save_filename/save_lineno to ensure
correct values for calls to define_label.
2000-08-29 Mark Mitchell <mark@codesourcery.com> 2000-08-29 Mark Mitchell <mark@codesourcery.com>
* calls.c (expand_call): Don't create a VAR_DECL just to throw it * calls.c (expand_call): Don't create a VAR_DECL just to throw it
......
...@@ -2747,12 +2747,14 @@ define_label (filename, line, name) ...@@ -2747,12 +2747,14 @@ define_label (filename, line, name)
} }
if (warn_traditional && !in_system_header && lookup_name (name)) if (warn_traditional && !in_system_header && lookup_name (name))
warning ("traditional C lacks a separate namespace for labels, identifier `%s' conflicts", warning_with_file_and_line (filename, line,
IDENTIFIER_POINTER (name)); "traditional C lacks a separate namespace for labels, identifier `%s' conflicts",
IDENTIFIER_POINTER (name));
if (DECL_INITIAL (decl) != 0) if (DECL_INITIAL (decl) != 0)
{ {
error ("duplicate label `%s'", IDENTIFIER_POINTER (name)); error_with_file_and_line (filename, line, "duplicate label `%s'",
IDENTIFIER_POINTER (name));
return 0; return 0;
} }
else else
......
...@@ -1951,14 +1951,14 @@ label: CASE expr_no_commas ':' ...@@ -1951,14 +1951,14 @@ label: CASE expr_no_commas ':'
genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree)); genrtl_case_label(CASE_LOW(case_label_tree), CASE_HIGH(case_label_tree));
position_after_white_space (); position_after_white_space ();
} }
| identifier ':' maybe_attribute | identifier ':' save_filename save_lineno maybe_attribute
{ tree label = define_label (input_filename, lineno, $1); { tree label = define_label ($3, $4, $1);
stmt_count++; stmt_count++;
emit_nop (); emit_nop ();
if (label) if (label)
{ {
expand_label (label); expand_label (label);
decl_attributes (label, $3, NULL_TREE); decl_attributes (label, $5, NULL_TREE);
} }
position_after_white_space (); } position_after_white_space (); }
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment