diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-01-30 03:31:59 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-01-30 03:31:59 +0000 |
commit | 59495f384361d2931f626d4a537b0b5a5edd6ab7 (patch) | |
tree | 79fd63777562408a7a168cbfdeed51b0d2eb1186 /gcc/cpplib.c | |
parent | 607ace9b9bec36a74b0c8f4af4ed0eefc6bddca3 (diff) | |
download | gcc-59495f384361d2931f626d4a537b0b5a5edd6ab7.zip gcc-59495f384361d2931f626d4a537b0b5a5edd6ab7.tar.gz gcc-59495f384361d2931f626d4a537b0b5a5edd6ab7.tar.bz2 |
cpperror.c (cpp_file_line_for_message): If 'line' is zero, just print "<command line>".
* cpperror.c (cpp_file_line_for_message): If 'line' is zero,
just print "<command line>". If 'filename' is null or an
empty string, print "<stdin>" for the filename.
* cpplib.c (do_define): Don't print the 'location of the
previous definition' message if we're still parsing the
command line.
(cpp_pedwarn_with_file_and_line): Always call
cpp_file_line_for_message.
From-SVN: r31697
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 44134e6..cdfdaa3 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -685,7 +685,7 @@ do_define (pfile, keyword) mdef.symlen, mdef.symnam); else cpp_pedwarn (pfile, "`%.*s' redefined", mdef.symlen, mdef.symnam); - if (hp->type == T_MACRO) + if (hp->type == T_MACRO && CPP_OPTIONS (pfile)->done_initializing) cpp_pedwarn_with_file_and_line (pfile, hp->value.defn->file, hp->value.defn->line, "this is the location of the previous definition"); @@ -3474,8 +3474,7 @@ cpp_pedwarn_with_file_and_line VPARAMS ((cpp_reader *pfile, const char *file, if (!CPP_OPTIONS (pfile)->pedantic_errors && CPP_OPTIONS (pfile)->inhibit_warnings) return; - if (file != NULL) - cpp_file_line_for_message (pfile, file, line, -1); + cpp_file_line_for_message (pfile, file, line, -1); v_cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors, msgid, ap); va_end(ap); } |