Xref: utzoo comp.std.c:3765 comp.text.tex:3381 Path: 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: Date: 15 Oct 90 13:20:25 GMT References: <1990Oct13.204721.8027@maths.tcd.ie> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 24 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.