Commit fba020b1 by Gabriel Dos Reis Committed by Gabriel Dos Reis

c-common.c (if_elt): Use location_t in lieu of "file, line" pair.

        * c-common.c (if_elt): Use location_t in lieu of "file, line" pair.
        (c_expand_start_cond): Adjust.
        (c_expand_end_cond): Don't use warning_with_file_and_file.
        (shadow_warning): Likewise.

From-SVN: r66304
parent 1dcfc9d1
2003-04-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-common.c (if_elt): Use location_t in lieu of "file, line" pair.
(c_expand_start_cond): Adjust.
(c_expand_end_cond): Don't use warning_with_file_and_file.
(shadow_warning): Likewise.
2003-04-30 Nathan Sidwell <nathan@codesourcery.com> 2003-04-30 Nathan Sidwell <nathan@codesourcery.com>
* tree.h (DECL_POINTER_DEPTH): Remove. * tree.h (DECL_POINTER_DEPTH): Remove.
......
...@@ -726,8 +726,7 @@ static int constant_fits_type_p PARAMS ((tree, tree)); ...@@ -726,8 +726,7 @@ static int constant_fits_type_p PARAMS ((tree, tree));
typedef struct typedef struct
{ {
int compstmt_count; int compstmt_count;
int line; location_t locus;
const char *file;
int needs_warning; int needs_warning;
tree if_stmt; tree if_stmt;
} if_elt; } if_elt;
...@@ -919,8 +918,8 @@ c_expand_start_cond (cond, compstmt_count, if_stmt) ...@@ -919,8 +918,8 @@ c_expand_start_cond (cond, compstmt_count, if_stmt)
/* Record this if statement. */ /* Record this if statement. */
if_stack[if_stack_pointer].compstmt_count = compstmt_count; if_stack[if_stack_pointer].compstmt_count = compstmt_count;
if_stack[if_stack_pointer].file = input_filename; if_stack[if_stack_pointer].locus.file = input_filename;
if_stack[if_stack_pointer].line = lineno; if_stack[if_stack_pointer].locus.line = lineno;
if_stack[if_stack_pointer].needs_warning = 0; if_stack[if_stack_pointer].needs_warning = 0;
if_stack[if_stack_pointer].if_stmt = if_stmt; if_stack[if_stack_pointer].if_stmt = if_stmt;
if_stack_pointer++; if_stack_pointer++;
...@@ -943,9 +942,8 @@ c_expand_end_cond () ...@@ -943,9 +942,8 @@ c_expand_end_cond ()
{ {
if_stack_pointer--; if_stack_pointer--;
if (if_stack[if_stack_pointer].needs_warning) if (if_stack[if_stack_pointer].needs_warning)
warning_with_file_and_line (if_stack[if_stack_pointer].file, warning ("%Hsuggest explicit braces to avoid ambiguous `else'",
if_stack[if_stack_pointer].line, &if_stack[if_stack_pointer].locus);
"suggest explicit braces to avoid ambiguous `else'");
last_expr_type = NULL_TREE; last_expr_type = NULL_TREE;
} }
...@@ -4787,9 +4785,7 @@ shadow_warning (msgcode, name, decl) ...@@ -4787,9 +4785,7 @@ shadow_warning (msgcode, name, decl)
}; };
warning (msgs[msgcode], name); warning (msgs[msgcode], name);
warning_with_file_and_line (DECL_SOURCE_FILE (decl), warning ("%Hshadowed declaration is here", &DECL_SOURCE_LOCATION (decl));
DECL_SOURCE_LINE (decl),
"shadowed declaration is here");
} }
/* Attribute handlers common to C front ends. */ /* Attribute handlers common to C front ends. */
......
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