From 14fbab6d759d8085be40343f06911c672539a2df Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 17 Nov 2000 19:21:15 +0000 Subject: [PATCH] cpperror.c (print_file_and_line): Don't display line number if 0. * cpperror.c (print_file_and_line): Don't display line number if 0. From-SVN: r37523 --- gcc/ChangeLog | 5 +++++ gcc/cpperror.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bddf1ec..2d200c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-11-17 Neil Booth + + * cpperror.c (print_file_and_line): Don't display line number + if 0. + 2000-11-17 Zack Weinberg * ggc.h: Delete ggc_add_string_root and ggc_mark_string. Add diff --git a/gcc/cpperror.c b/gcc/cpperror.c index d598fbd..ff83c6f 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -86,19 +86,19 @@ print_containing_files (pfile, ip) } static void -print_file_and_line (filename, line, column) +print_file_and_line (filename, line, col) const char *filename; - unsigned int line, column; + unsigned int line, col; { if (filename == 0 || *filename == '\0') filename = ""; - if (line == (unsigned int)-1) + if (line == 0) fprintf (stderr, "%s: ", filename); - else if (column > 0) - fprintf (stderr, "%s:%u:%u: ", filename, line, column); - else + else if (col == 0) fprintf (stderr, "%s:%u: ", filename, line); + else + fprintf (stderr, "%s:%u:%u: ", filename, line, col); } /* Set up for an error message: print the file and line, bump the error -- 2.7.4