home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / std / c / 2972 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!usenet.ins.cwru.edu!ncoast!brown
  3. From: brown@NCoast.ORG (Stan Brown)
  4. Subject: Re: is fflush(stdin) conformant???
  5. Organization: Oak Road Systems, Cleveland Ohio USA
  6. Distribution: comp
  7. Date: Fri, 6 Nov 1992 01:50:45 GMT
  8. Message-ID: <Bx9uGn.457@NCoast.ORG>
  9. References: <MGK.92Nov2131855@cedar.sql.sybase.com>
  10. Lines: 25
  11.  
  12. In article <MGK.92Nov2131855@cedar.sql.sybase.com> mgk@sql.sybase.com (Michael Keirnan aka Joe Cool) writes:
  13.  
  14. ANSI sec 4.9.5.2 (ISO 7.9.5.2, I believe):
  15.  
  16. "int fflush(FILE *stream);
  17.  
  18. "Description
  19.  
  20. "If stream points to an output stream or an update stream in which the
  21. most recent operation was not input, the fllush function causes any
  22. unwritten data for that stream to be delivered to the host environment
  23. to be written to the file; otherwise, the behavior is undefined. ..."
  24.  
  25. In John Woods's felicitous image, undefined behavior means that the
  26. program can do anything, including causing demons to fly into (or is it
  27. out of?) your nose.
  28.  
  29. Someone who is teaching a course and advocates fflush(stdin); may be
  30. teaching about some vendor's version of C, but is not teaching an ANSI C
  31. course.
  32. -- 
  33. Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
  34. Cleveland, Ohio, USA
  35. "Only the futility of the first flood prevents God from unleashing another."
  36.             --Chamfort, as quoted in Claude Arnaud's {Chamfort: A Biography}
  37.