Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!munnari.oz.au!comp.vuw.ac.nz!massey!ARaman From: ARaman@massey.ac.nz (A.V. Raman) Newsgroups: comp.unix.questions Subject: Where are you malloc? I loc you still. Where are you? Keywords: malloc, include files, declaration Message-ID: <352@massey.ac.nz> Date: 2 Oct 89 23:02:33 GMT Reply-To: ARaman@massey.ac.nz (A.V. Raman) Organization: Massey University, Palmerston North, New Zealand Lines: 43 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 #include2 #include 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@massey.ac.nz Ph: +64-63-69099 x7943 NZ = GMT + 12