[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison 1.30b
From: |
Akim Demaille |
Subject: |
Re: Bison 1.30b |
Date: |
14 Nov 2001 14:59:54 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) |
| Also, in main.c, main() definition, I have to add
| return EXIT_SUCCESS;
| -- I think it may to do with past different language versions of C/C++
| whther this must be added or not. (I merely ensure that it is added.) On my
| computer, EXIT_SUCCESS and EXIT_FAILURE are defined in stdlib.h/cstdlib.
| One could add
| #ifndef EXIT_SUCCESS
| #define EXIT_SUCCESS 0
| #endif
| #ifndef EXIT_FAILURE
| #define EXIT_FAILURE 1
| #endif
| as that probably will be the values if there is a platform that does not
| have those macros defined.
Thanks Hans. I'm applying this:
Index: ChangeLog
from Akim Demaille <address@hidden>
* src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
definition.
* src/main.c (main): Use them.
Suggested by Hans Aberg.
Index: src/main.c
===================================================================
RCS file: /cvsroot/bison/bison/src/main.c,v
retrieving revision 1.30.2.7
diff -u -u -r1.30.2.7 main.c
--- src/main.c 2001/11/12 09:19:48 1.30.2.7
+++ src/main.c 2001/11/14 14:14:29
@@ -117,7 +117,7 @@
output_files ();
- exit (complain_message_count ? 1 : 0);
+ return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS;
}
/* Abort for an internal error denoted by string S. */
Index: src/system.h
===================================================================
RCS file: /cvsroot/bison/bison/src/system.h,v
retrieving revision 1.23.2.5
diff -u -u -r1.23.2.5 system.h
--- src/system.h 2001/11/12 10:11:49 1.23.2.5
+++ src/system.h 2001/11/14 14:14:29
@@ -40,6 +40,18 @@
# include <stdlib.h>
#endif
+/* The following test is to work around the gross typo in
+ systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
+ is defined to 0, not 1. */
+#if !EXIT_FAILURE
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+
#if HAVE_UNISTD_H
# include <unistd.h>
#endif