home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11324 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.4 KB  |  49 lines

  1. Path: sparky!uunet!caen!uflorida!pine.circa.ufl.edu!hans
  2. From: hans@pine.circa.ufl.edu (Hans van Oostrom)
  3. Newsgroups: comp.lang.c++
  4. Subject: Bug in Borland C++ 3.1: demonstration included
  5. Message-ID: <22JUL199211253387@pine.circa.ufl.edu>
  6. Date: 22 Jul 92 16:25:00 GMT
  7. Sender: news@uflorida.cis.ufl.edu
  8. Organization: University of Florida - Dept. of Anesthesiology
  9. Lines: 36
  10. Nntp-Posting-Host: pine.circa.ufl.edu
  11. News-Software: VAX/VMS VNEWS 1.41
  12.  
  13. I ran into a piece of code that will crash the Borland 3.1 compiler when
  14. you compile it.  It gives a General Protection Fault Exception 0D in the
  15. bcc and bc compilers (I haven't try the tcw one).  Try the following at home:
  16.  
  17. // file showbug.cpp
  18.  
  19. #include <stdio.h>
  20.  
  21. void main()
  22. {
  23.     stat();
  24. }
  25.  
  26. void stat(void)
  27. {
  28.     printf("hello");
  29. }
  30.  
  31. void another()
  32. {
  33.     stat();
  34. }
  35.  
  36. I know that this is supposed to generate an error message because the stat
  37. function doesn't have a prototype.  I also know that stat is defined as 
  38. something else in the sys\stat.h file, but since I am not using that it
  39. should be ok.  If you change the name of stat or include a prototype it
  40. works ok.  
  41.  
  42. If anybody can shine some light on this I would be interested.
  43. I will forward this to Borland.
  44.  
  45. Hans van Oostrom                    KD4MUJ
  46. PO Box J-254, JHMHC                 hans@ufpine                (BITNET)
  47. Gainesville, FL  32601, USA         hans@pine.circa.ufl.edu    (INTERNET)
  48. >>>          Hoe ver je ook gaat, overal zie je landgenoten           <<<
  49.