home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11332 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.8 KB

  1. Path: sparky!uunet!gatech!prism!gt7749b
  2. From: gt7749b@prism.gatech.EDU (Chris M.)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Bug in Borland C++ 3.1: demonstration included
  5. Message-ID: <64105@hydra.gatech.EDU>
  6. Date: 22 Jul 92 17:39:26 GMT
  7. References: <22JUL199211253387@pine.circa.ufl.edu>
  8. Organization: Georgia Institute of Technology
  9. Lines: 61
  10.  
  11. In article <22JUL199211253387@pine.circa.ufl.edu> hans@pine.circa.ufl.edu (Hans van Oostrom) writes:
  12. >I ran into a piece of code that will crash the Borland 3.1 compiler when
  13. >you compile it.  It gives a General Protection Fault Exception 0D in the
  14. >bcc and bc compilers (I haven't try the tcw one).  Try the following at home:
  15. >
  16. >// file showbug.cpp
  17. >[ code deleted ]
  18. >
  19. >I know that this is supposed to generate an error message because the stat
  20. >function doesn't have a prototype.  I also know that stat is defined as 
  21. >something else in the sys\stat.h file, but since I am not using that it
  22. >should be ok.  If you change the name of stat or include a prototype it
  23. >works ok.  
  24. >
  25. >If anybody can shine some light on this I would be interested.
  26. >I will forward this to Borland.
  27. >
  28.  
  29.  
  30. I hate to tell you this, but its not a bug in BCC/BC/ etc.
  31.  
  32. I just attemopted to compile your program in BC, and with BCC.  
  33. Both programs spit out an error about prototypes -- I got no
  34. exception faults.
  35.  
  36. The exception Fault (0d) has never happened to me on the machine I am on:
  37. an AST Premium 486sx II.
  38.  
  39. However, on a 386/25, I have gotten a 0D.  Let me tell you what caused the
  40. 0D exception:
  41.  
  42. My memory chips on the 386/25 are too slow to keep up with the 25 mhz
  43. speed of my 386.  However, running the compuyter at 20mhz got rid of any
  44. 0D errors I have gotten.  I have tested it alot (The 0D trap) -- it
  45. seems to be egenrated when memory cannot keep up with the processor.
  46. My memory is .. 80ns +.
  47.  
  48. Borland may or may not have a clue as to what you are talking about:
  49. I am sure on their machines the compile will gebnerate an error,
  50. just like it did here.  Like I said, I took your code piece, and
  51. the compiler generated two prototyping errors  (stat() needs a 
  52. prototype...) 
  53.  
  54. You may consider running your computer at a lower speed;  (I assume you
  55. have at least a 286 since you are using bc 3.1).  If this silves
  56. your problem, you will need memory chips that are faster.  If you
  57. have a 486, you will generally need 53ns-60ns chips to avoid the
  58. problem.
  59.  
  60. The reason that BC may fail while other programs doesn't is because
  61. BC uses your memory intensely, and thus, pushes it to its limit.
  62.  
  63. OS/2 or Unix would more than likely fail at points on your computer
  64. if your memory isn't fast enough to keep up with the processor.
  65.  
  66.  
  67. -- 
  68. Chris McClellen  
  69. Just Another Student, Georgia Institute of Technology
  70. Internet: gt7749b@prism.gatech.edu, ccastcm@prism.gatech.edu 
  71. "Death may smell bad, but LIFE STINKS!"  
  72.