This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to make cpplib errors say "error: "


Just as compiler error messages include "error: ", so should cpplib
error messages.  Fixed thus.

Bootstrapped with no regressions on i686-pc-linux-gnu.  OK to commit?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

libcpp:
2004-10-05  Joseph S. Myers  <jsm@polyomino.org.uk>

	* errors.c (_cpp_begin_message): Print "error: " for errors.

gcc/testsuite:
2004-10-05  Joseph S. Myers  <jsm@polyomino.org.uk>

	* gcc.dg/cpp/error-1.c: New test.

diff -rupN GCC.orig/gcc/testsuite/gcc.dg/cpp/error-1.c GCC/gcc/testsuite/gcc.dg/cpp/error-1.c
--- GCC.orig/gcc/testsuite/gcc.dg/cpp/error-1.c	1970-01-01 00:00:00.000000000 +0000
+++ GCC/gcc/testsuite/gcc.dg/cpp/error-1.c	2004-10-04 23:14:54.000000000 +0000
@@ -0,0 +1,5 @@
+/* Test that error messages include "error:" in the text.  */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do preprocess } */
+
+/* { dg-error "error: unterminated comment" }
diff -rupN GCC.orig/libcpp/errors.c GCC/libcpp/errors.c
--- GCC.orig/libcpp/errors.c	2004-05-24 10:50:44.000000000 +0000
+++ GCC/libcpp/errors.c	2004-10-04 23:11:48.000000000 +0000
@@ -118,6 +118,8 @@ _cpp_begin_message (cpp_reader *pfile, i
     fputs (_("warning: "), stderr);
   else if (level == CPP_DL_ICE)
     fputs (_("internal error: "), stderr);
+  else
+    fputs (_("error: "), stderr);
 
   return 1;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]