home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / linux / 17392 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1001 b   |  41 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!think.com!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!ehsn11.cen.uiuc.edu!jy10033
  3. From: jy10033@ehsn11.cen.uiuc.edu (Joshua M Yelon)
  4. Subject: Re: function-->macro bugs.
  5. References: <By0ows.95I@news.cso.uiuc.edu> <1992Nov21.000241.9744@klaava.Helsinki.FI>
  6. Message-ID: <By1p2E.5L9@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Organization: University of Illinois at Urbana
  9. Date: Sat, 21 Nov 1992 02:47:01 GMT
  10. Lines: 29
  11.  
  12. I wrote this:
  13.  
  14. >>3. This is correct:
  15. >>
  16. >>/* My-super-efficient-malloc: */
  17. >>static void *malloc(n)
  18. >>int n;
  19. >>{...
  20.  
  21. Lars replied:
  22.  
  23. >Nope, not if you include <stdlib.h>.  You cannot have declarations /
  24. >definitions for malloc that specify both external and internal
  25. >linkage.
  26.  
  27. I'm not disagreeing with Lars, in fact I'm quite certain he's right,
  28. but I'm curious:  how _do_ you replace a library routine?
  29. Is THIS correct?
  30.  
  31. #undef malloc
  32. void *malloc(n)
  33. int n;
  34. {
  35. ...
  36.  
  37. Or is there simply no way to do it?
  38.  
  39. - Josh
  40.  
  41.