DVItoPS on DECstation

Eamonn McManus em at dce.ie
Mon Oct 15 23:20:25 AEST 1990


In article <1990Oct13.204721.8027 at maths.tcd.ie> tim at maths.tcd.ie (Timothy Murphy) writes:
> I was recently compiling the TeX PostScript driver program dvitops
> on a DECstation,
> and was surprised to find that the compiler didn't like
>	fopen(filename, "rb");

Older Unix stdio implementations were only specified to take "r", "w", and
"a" for the mode argument, each with a possible "+" appended.  However, the
implementation in fact just looked at the first character and at whether the
second character was '+'.  Apparently the Ultrix people decided that they
would tighten up the checking, so where "rb" would be accepted before it is
now rejected by Ultrix.  This is unfortunate, because the ANSI C standard
requires "rb" to mean open in binary rather than text mode, when there is
a difference.


> And should the DECstation compiler have complained at compile-time,
> if it didn't understand the argument?

That would require the compiler to recognise the fopen() function
specially.  Very few implementors would consider this to be worthwhile just
for that check.  Prior to ANSI C, there was no reason to suppose that a
reference to fopen() would actually be resolved to the stdio function of
that name.



More information about the Comp.std.c mailing list