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/cpperror.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/cpperror.c')
-rw-r--r-- | gcc/cpperror.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c index 40fb26e..d0900e8 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -84,7 +84,11 @@ cpp_file_line_for_message (pfile, filename, line, column) const char *filename; int line, column; { - if (column > 0) + if (filename == 0 || *filename == '\0') + filename = "<stdin>"; + if (line == 0) + fputs (_("<command line>: "), stderr); + else if (column > 0) fprintf (stderr, "%s:%d:%d: ", filename, line, column); else fprintf (stderr, "%s:%d: ", filename, line); |