home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / msdos / programm / 10818 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.4 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!b63519.STUDENT.CWRU.Edu!dpn2
  2. From: dpn2@po.CWRU.Edu (Damien P. Neil)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: BC++ 3.1 bug?
  5. Date: Sat, 21 Nov 1992 06:31:16 GMT
  6. Organization: Case Western Reserve University
  7. Lines: 32
  8. Message-ID: <dpn2.133.722327476@po.CWRU.Edu>
  9. References: <1992Nov20.174122.2729@microware.com>
  10. NNTP-Posting-Host: b63519.student.cwru.edu
  11.  
  12. In article <1992Nov20.174122.2729@microware.com> adam@microware.com (Adam Goldberg) writes:
  13. >The following produces an interesting error:
  14. >
  15. >#include <dos.h>
  16. >#include <mem.h>
  17. >
  18. >void main(void)
  19. >{
  20. >   unsigned short far *ppm, *dest;
  21. >
  22. >   if(NULL == (ppm = (unsigned short far *)farmalloc(1024)))
  23. >   {
  24. >      error message...
  25. >   }
  26. >
  27. >   if(NULL == (dest = (unsigned short far *)farmalloc(1024)))
  28. >   {
  29. >      error message...
  30. >   }
  31. >
  32. >This produces an error on the _second_ farmalloc(), "suspicious
  33. >pointer conversion". (not on the first...)
  34.  
  35. Try:           unsigned short far *ppm, far *dest;
  36.  
  37. You need to specifically declare each pointer far.
  38.  
  39. BTW -- a minor nit: main() should be declared as returning an int...
  40. Damien Neil   dpn2@po.cwru.edu      "Until somebody debugs reality, the best
  41. CMPS/EEAP double majoring masochist  I can do is a quick patch here and there."
  42. Case Western Reserve University                   - Erik Green
  43.