Problem in C with void function?

john howell jh34607 at suntc.UUCP
Sat Dec 23 01:25:44 AEST 1989


I have a C program I am porting to my SGI 4D/70G running IRIX 3.2 and I
came across the following set of code that causes problems.

There are wrappers around the standard malloc functions of which the
realloc one I have here exhibits problems.

When I compile this code with
	cc test.c
I get the following error message:

ccom: Error: test.c, line 10: mem_pointer undefined
          return( (void *) realloc( mem_pointer, byte_count ) );
      -----------------------------------------^
(ccom): test.c, line 10: cannot recover from earlier errors: goodbye!
      }
      ^
Does this seem right?

Here's test.c

#include <sys/types.h>
#include <malloc.h>

void *mem_reallocate( mem_pointer, byte_count )
    
    void    *mem_pointer;
    size_t  byte_count;
{
    return( (void *) realloc( mem_pointer, byte_count ) );
}

Thanks for any help.

John



========================================================================
John Howell			uucp:		uunet!suntc!jrh
Deere & Company			MCImail:	360-4047
Technical Center		CompuServe:	[76666,2505]
3300 River Drive		FAX:		(309)765-3807
Moline, IL  61265		Voice:		(309)765-3784
========================================================================



More information about the Comp.lang.c mailing list