home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4232 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  56 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: lut.ac.uk!usenet
  3. From: PJ Common <p.j.common1@student.lut.ac.uk>
  4. Subject: C Compiler Bug
  5. Sender: usenet@lut.ac.uk (Usenet-News)
  6. Message-ID: <3131996E.41C67EA6@student.lut.ac.uk>
  7. Date: Mon, 26 Feb 1996 11:28:46 GMT
  8. X-Nntp-Posting-Host: sun-co03.lut.ac.uk
  9. Content-Transfer-Encoding: 7bit
  10. Content-Type: text/plain; charset=us-ascii
  11. Mime-Version: 1.0
  12. X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4c)
  13. Organization: Loughborough University, UK.
  14.  
  15. Anyone had any problems with Dice C 3.01 when using floating point
  16. arithmetic.
  17. As an example the following simple program which is known to 
  18. compile and work crashes dc1 - the actual dice compiler.
  19.  
  20. /* test.c */
  21. /* program to convert inches to feet */
  22. #include <stdio.h>
  23.  
  24. void main(void)
  25. {
  26. float    feet;
  27. int    inches = 0, start_value = 0, end_value = 24, step_value = 6;
  28.  
  29. printf("inches\tfeet\n");
  30. while (inches <= end_value)
  31.     {
  32.     feet = inches / 12.0;
  33.     printf("%d\t%.2f\n",inches,feet);
  34.     inches += step_value;
  35.     }
  36. }
  37.  
  38. The program was compiled from the CLI using
  39.     dcc -lm test.c
  40.  
  41. dc1 fails with the error #8000000B.
  42.  
  43. Using Snoopdos shows all goes well until dc1 loads the math librarys.
  44. As a test the math libs (in libs:) were removed, dc1 still crashes.
  45.  
  46. The ultimate test was installing dice to floppy, booting from the
  47. workbench 3.0 floppys (so as to avoid accessing my hd)and compiling the
  48. program from there - same result dc1 crahses. Ahhhh!!!
  49.  
  50. I'm a fairly proficient amiga user (A1200,6meg,fpu,hd,3.0), but this one
  51. has  beaten me and got me really pissed off. Any help appreciated.
  52.  
  53. Cheers, Paul
  54.  
  55. Replies to this group and/or P.J.Common1@student.lut.ac.uk
  56.