diff options
author | Richard Stallman <rms@gnu.org> | 1993-09-28 23:23:11 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-09-28 23:23:11 +0000 |
commit | 0ce958d05974a1f56585e9bc6faeaa11f3e09458 (patch) | |
tree | b7724548e169d05090d86988a75bacda4c2a964c /gcc/bi-opname.c | |
parent | ae0d82889377bd53b8aec69303ae02efae9b666c (diff) | |
download | gcc-0ce958d05974a1f56585e9bc6faeaa11f3e09458.tar.gz |
Include stdio.h.
(xmalloc): New function.
From-SVN: r5520
Diffstat (limited to 'gcc/bi-opname.c')
-rw-r--r-- | gcc/bi-opname.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/bi-opname.c b/gcc/bi-opname.c index ac2d84a5235..52ca500548e 100644 --- a/gcc/bi-opname.c +++ b/gcc/bi-opname.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License 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 @@ -33,3 +34,20 @@ main() printf("\"%s%s\",\n", d->basename, v->name); 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; +} |