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]

Re: Exit code for errors detected by cpplib


Just two comments from someone that does not know much about gcc.

+ unsigned int
+ cpp_get_num_errors ()
+ {
+   return cpp_errors;
+ }
+ 
+ void
+ cpp_get_num_errors (num)
+      unsigned int num;
+ {
+   cpp_errors = num;

There is at least a typo here....
The second cpp_get_num_errors should be a cpp_set_num_errors...

+ #ifdef USE_CPPLIB
+   /* Make sure that any errors detected by cpplib get reflected in the
+      exit status of gcc.  */
+   if (cpp_get_num_errors ())
+     ++ errorcount;
+ #endif

Also I wonder why you don't use:

errorcount += cpp_get_num_errors ();

	Theo.

--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



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