This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Exit code for errors detected by cpplib
- To: nickc at cygnus dot co dot uk
- Subject: Re: Exit code for errors detected by cpplib
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Date: Mon, 29 Nov 1999 20:23:44 +0100
- cc: gcc-patches at gcc dot gnu dot org
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
--------------------------------------------------------------------