summaryrefslogtreecommitdiff
path: root/gcc/gencheck.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-06-06 09:25:16 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-06-06 09:25:16 +0000
commit83e0821b6037a62cc8b865bfb89e8c4011ecbc96 (patch)
tree5254ed03752711c180fe7b0b7997af811aeffd2b /gcc/gencheck.c
parent8db79477cd5af63639b2440fceb76f74afb8b969 (diff)
Some fixes for KNR compilers:
* gencheck.c: Remove redundant stdio.h include. Add a definition of xmalloc for when we are forced to link with alloca.o. * reload1.c (reload_reg_free_for_value_p): Use `(unsigned)1' instead of `1U'. * fold-const.c (constant_boolean_node): Make definition static to match the prototype. From-SVN: r20261
Diffstat (limited to 'gcc/gencheck.c')
-rw-r--r--gcc/gencheck.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/gencheck.c b/gcc/gencheck.c
index 6b5612ded31..811a7dca752 100644
--- a/gcc/gencheck.c
+++ b/gcc/gencheck.c
@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
#include "system.h"
@@ -60,3 +59,22 @@ int main (argc, argv)
return 0;
}
+#if defined(USE_C_ALLOCA) && !defined(__GNUC__)
+/* FIXME: We only need an xmalloc definition because we are forced to
+ link with alloca.o on some platforms. This should go away if/when
+ we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
+char *
+xmalloc (nbytes)
+ int nbytes;
+{
+ char *tmp = (char *) malloc (nbytes);
+
+ if (!tmp)
+ {
+ fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
+ exit (FATAL_EXIT_CODE);
+ }
+
+ return tmp;
+}
+#endif /* USE_C_ALLOCA && !__GNUC__ */