diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-08-29 18:37:37 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-08-29 18:37:37 +0000 |
commit | 2c8f0515bbed378f1e87e1b52e2913d058cbed16 (patch) | |
tree | 7f03453e92f612da7c6531488d3878a73dbda657 /gcc/cpperror.c | |
parent | 5c5d1cd68a748299a244a6b9fd7c3fce2f09d582 (diff) | |
download | gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.zip gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.gz gcc-2c8f0515bbed378f1e87e1b52e2913d058cbed16.tar.bz2 |
cpperror.c (print_file_and_line): If line is (unsigned int)-1, print just the filename.
* cpperror.c (print_file_and_line): If line is (unsigned int)-1,
print just the filename.
* cpplex.c (_cpp_run_directive): Add additional argument, the
name to give the synthetic buffer. This defaults to
translated "<command line>".
* cpplib.c (cpp_define, cpp_undef, cpp_assert, cpp_unassert):
Adjust to match.
(_cpp_define_builtin): New function.
* cppinit.c (initialize_builtins): Use _cpp_define_builtin.
* cpphash.h: Update prototypes.
* tradcpp.c (main): Process -D and -U simultaneously, in the
order they appeared on the command line.
From-SVN: r36043
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r-- | gcc/cpperror.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c index edf1992..a6c7b2d 100644 --- a/gcc/cpperror.c +++ b/gcc/cpperror.c @@ -91,17 +91,15 @@ print_file_and_line (filename, line, column) const char *filename; unsigned int line, column; { - if (line == 0) - fputs (_("<command line>: "), stderr); + if (filename == 0 || *filename == '\0') + filename = "<stdin>"; + + if (line == (unsigned int)-1) + fprintf (stderr, "%s: ", filename); + else if (column > 0) + fprintf (stderr, "%s:%u:%u: ", filename, line, column); else - { - if (filename == 0 || *filename == '\0') - filename = "<stdin>"; - if (column > 0) - fprintf (stderr, "%s:%u:%u: ", filename, line, column); - else - fprintf (stderr, "%s:%u: ", filename, line); - } + fprintf (stderr, "%s:%u: ", filename, line); } /* Set up for an error message: print the file and line, bump the error |