diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-28 23:23:11 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-09-28 23:23:11 +0000 |
commit | ddfde506e604bf9cfb392dec36eaa297653f9c43 (patch) | |
tree | b7724548e169d05090d86988a75bacda4c2a964c /gcc/bi-arity.c | |
parent | db42ccea7b15666310ab61f3b26aad38192578c3 (diff) | |
download | ppe42-gcc-ddfde506e604bf9cfb392dec36eaa297653f9c43.tar.gz ppe42-gcc-ddfde506e604bf9cfb392dec36eaa297653f9c43.zip |
Include stdio.h.
(xmalloc): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bi-arity.c')
-rw-r--r-- | gcc/bi-arity.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/bi-arity.c b/gcc/bi-arity.c index 26dde7cbc20..69ed788d3ad 100644 --- a/gcc/bi-arity.c +++ b/gcc/bi-arity.c @@ -18,6 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <stdio.h> #include "bi-defs.h" int @@ -54,3 +55,20 @@ main () } return 0; } + +/* Safely allocate NBYTES bytes of memory. Returns pointer to block of + memory. */ +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 (1); + } + + return tmp; +} |