This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: minor patch for include/fopen-bin.h


On Tue, 30 May 2000, Mark E. wrote:

> That patch adds 't' to the text mode fopen macros for DOS and Windows.
> Since the default can either be binary or text depending on the
> particular system library, it's better to explicitly set text mode
> instead of presuming it's the default.

I have some doubts that this is a good idea. At the very least, this would
require a 'configure' test. The point is that "rt" mode in fopen() is not
guaranteed to exist, even on platforms that do need "rb" mode for binary
files. The "t" qualifier is a DOSism, AFAIK, and a rather silly one, too.
We should not assume that "rt" exists without testing for that. The patch
may break more than it's ever going to heal, otherwise.

Not even to mention that a platform where fopen() defaults to "b" mode is
explicitly violating every existing definition of the C language. None of
the platforms supporting "rt" mode that I've seen defaults to this
non-standard mode.

Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]