home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / c / 13189 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.5 KB

  1. Path: sparky!uunet!news.claremont.edu!ucivax!news.service.uci.edu!beckman.com!dn66!a_rubin
  2. Newsgroups: comp.lang.c
  3. Subject: Re: MS-C fread bug
  4. Message-ID: <a_rubin.715550662@dn66>
  5. From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
  6. Date: 3 Sep 92 20:04:22 GMT
  7. References: <1992Sep3.141100.28778@wuecl.wustl.edu>
  8. Nntp-Posting-Host: dn66.dse.beckman.com
  9. Lines: 26
  10.  
  11. In <1992Sep3.141100.28778@wuecl.wustl.edu> drm4005@wuee1.wustl.edu (David Russell Maffitt) writes:
  12.  
  13. >Here is a simple piece of code that does not work under MS-C versions 6.0 or
  14. >7.0.  WHY?  Just save the file as main.c and compile with "cl main.c".
  15.  
  16. >What is magic about the value 70.689651???  This works fine if I change
  17. >the value slightly (70.689600 works but 70.689650 does not).  Is this a
  18. >horrible bug or do I have more brain damage than I realize??
  19. >I'd appreciate a sanity check.  I'd like to hear how this runs on similar
  20. >and different hardware with the Microsoft compiler.  
  21.  
  22. >----- start file main.c --------------------------------------------------
  23. >#include <stdio.h>
  24.  
  25. >#define MAGIC   70.689651
  26.  
  27. (rest of code ommitted)
  28.  
  29. MAGIC has a byte which has the value 0x1A, which is processed as an end of
  30. file by MS-DOS.  If you open fp2 in mode "rb" instead of "r", there is no
  31. problem.
  32. --
  33. Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
  34. 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
  35. My opinions are my own, and do not represent those of my employer.
  36. My interaction with our news system is unstable; please mail anything important.
  37.