Where are you malloc? I loc you still. Where are you?

A.V. Raman ARaman at massey.ac.nz
Tue Oct 3 09:02:33 AEST 1989


Where are you malloc?  I loc you still.  Where are you?
-------------------------------------------------------
Synopsis:
~~~~~~~~~
Why isn't malloc () declared in *.h of ucb include in a
Pyramid OSx 4.4?


Why does this happen?   (Pyramid OSx 4.4)

% cc -c temp.c
"temp.c", line 8: warning: incompatible pointers on left and right sides of =
% cat -n temp.c | head -8
     1	#include <stdio.h>
     2	#include <mp.h>
     3	
     4	test ()
     5	{
     6	   char *p;
     7	
     8	   p = malloc (BUFSIZ);
% universe
ucb
% grep lloc /usr/include/*
/usr/include/mp.h:extern short *xalloc();
% ls /usr/include | grep mem
% ls /usr/include | grep lloc
% att
% ls /usr/include | grep alloc
malloc.h
%

I think if a non-default library function is provided for general use,
it's declaration in a .h file is as important as its documentation in
the manual.  Why do I have to explicitly declare malloc, calloc and
other such things in my C source in a ucb universe, whereas I can
just include malloc.h in the att universe and have it done automatically.

-- 
/*----------------------------------------------------------------------*/
Anand Venkataraman - Systems group, Computer Center, Massey University,
Palmerston North, New Zealand
INTERNET: A.Raman at massey.ac.nz  Ph: +64-63-69099 x7943  NZ = GMT + 12



More information about the Comp.unix.questions mailing list