Pascal --> C question

Doug Gwyn gwyn at brl-smoke.ARPA
Sat Mar 26 08:26:51 AEST 1988


In article <225800017 at uxe.cso.uiuc.edu> mcdonald at uxe.cso.uiuc.edu writes:
>Thus, as a corollary, if by some chance a C standard io stream gets 
>connected to a file that isn't stream, the results would be "system dependent",
>which implies that the implementer CAN'T BE WRONG! If VMS C connects to
>stream-LF files, then, and only then, would a flush be broken.

My understanding of the requirements in the draft proposed ANSI C
standard is that a conforming implementation is obliged to provide
(correctly!) at least one file format each for text streams and
for binary streams.  Although it may support more formats, it need
not do so.  However, vendors are well advised to attempt to do the
best job they can with each file format their system supports,
because it is not nice to tell the customer that C programs can
manipulate some kinds of files but not others.

Thus, technically, so long as VMS C had the right behavior on one
text stream format (stream-LF for example), the fact that it did
not handle other formats sanely would not make it nonconforming
in the strictest sense, merely broken.  I'm not sure if the fact
that it attempted to manipulate another format without reporting
an error couldn't be considered nonconforming, though -- I think
a case could be made that if a format is unsupported it shouldn't
pretend to work at all (i.e. fopen(), printf(), etc. should fail
on such a stream).



More information about the Comp.lang.c mailing list