From e4f316dbfc784ec94dd573ce29ca9390fe6f202e Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 6 Oct 1993 22:54:04 +0000 Subject: [PATCH] (xmalloc, xrealloc): Cast the result of malloc, realloc. From-SVN: r5650 --- gcc/bi-lexer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/bi-lexer.c b/gcc/bi-lexer.c index 5e17d783dad..d631fb60cd8 100644 --- a/gcc/bi-lexer.c +++ b/gcc/bi-lexer.c @@ -33,7 +33,7 @@ static char * xmalloc (nbytes) int nbytes; { - char *tmp = malloc (nbytes); + char *tmp = (char *) malloc (nbytes); if (!tmp) { @@ -53,7 +53,9 @@ xrealloc (block, nbytes) char *block; int nbytes; { - char *tmp = block ? realloc (block, nbytes) : malloc (nbytes); + char *tmp = (block + ? (char *) realloc (block, nbytes) + : (char *) malloc (nbytes)); if (!tmp) { -- 2.30.2