🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1839

Re: DVItoPS on DECstation

#1839
From: Eamonn McManus
Date: Mon, 15 Oct 1990 13:20
24 lines
1625 bytes
In article <1990Oct13.204721.8027@maths.tcd.ie> tim@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.
Technical Details
Message-ID: <dyspepsia@dce.ie>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!tcdcs!dce.ie!em
References: <1990Oct13.204721.8027@maths.tcd.ie>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!tcdcs!dce.ie!em
From: em@dce.ie (Eamonn McManus)
Newsgroups: comp.std.c,comp.text.tex
Subject: Re: DVItoPS on DECstation
Summary: "rb" and "wb" are new to fopen()
Message-ID: <dyspepsia@dce.ie>
Date: 15 Oct 90 13:20:25 GMT
References: <1990Oct13.204721.8027@maths.tcd.ie>
Organization: Datacode Communications Ltd, Dublin, Ireland
Lines: 24