From 2b9117afd21ac57a437e5b907d0ee4d91698af93 Mon Sep 17 00:00:00 2001 From: zack Date: Sun, 30 Jan 2000 03:31:59 +0000 Subject: * cpperror.c (cpp_file_line_for_message): If 'line' is zero, just print "". If 'filename' is null or an empty string, print "" 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31697 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cpperror.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/cpperror.c') diff --git a/gcc/cpperror.c b/gcc/cpperror.c index 40fb26ecebb..d0900e84373 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 = ""; + if (line == 0) + fputs (_(": "), stderr); + else if (column > 0) fprintf (stderr, "%s:%d:%d: ", filename, line, column); else fprintf (stderr, "%s:%d: ", filename, line); -- cgit v1.2.1