Article View: comp.std.c
Article #2073Re: is fflush(stdin) conformant???
From: Stan Brown
Date: Fri, 06 Nov 1992 01:50
Date: Fri, 06 Nov 1992 01:50
25 lines
1470 bytes
1470 bytes
In article <MGK.92Nov2131855@cedar.sql.sybase.com> mgk@sql.sybase.com (Michael Keirnan aka Joe Cool) writes:
ANSI sec 4.9.5.2 (ISO 7.9.5.2, I believe):
"int fflush(FILE *stream);
"Description
"If stream points to an output stream or an update stream in which the
most recent operation was not input, the fllush function causes any
unwritten data for that stream to be delivered to the host environment
to be written to the file; otherwise, the behavior is undefined. ..."
In John Woods's felicitous image, undefined behavior means that the
program can do anything, including causing demons to fly into (or is it
out of?) your nose.
Someone who is teaching a course and advocates fflush(stdin); may be
teaching about some vendor's version of C, but is not teaching an ANSI C
course.
--
Stan Brown, Oak Road Systems brown@Ncoast.ORG
Cleveland, Ohio, USA
"Only the futility of the first flood prevents God from unleashing another."
--Chamfort, as quoted in Claude Arnaud's {Chamfort: A Biography}
Technical Details
Message-ID:
<Bx9uGn.457@NCoast.ORG>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!usenet.ins.cwru.edu!ncoast!brownReferences:
<MGK.92Nov2131855@cedar.sql.sybase.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!usenet.ins.cwru.edu!ncoast!brown From: brown@NCoast.ORG (Stan Brown) Subject: Re: is fflush(stdin) conformant??? Organization: Oak Road Systems, Cleveland Ohio USA Distribution: comp Date: Fri, 6 Nov 1992 01:50:45 GMT Message-ID: <Bx9uGn.457@NCoast.ORG> References: <MGK.92Nov2131855@cedar.sql.sybase.com> Lines: 25