[patch] Always open files in binary mode

Aaron Ballman aaron at aaronballman.com
Mon Feb 24 05:44:04 PST 2014


On Sun, Feb 23, 2014 at 9:25 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
> It looks like everything on windows these days can handle unix line endings.

Not quite everything -- Notepad.exe can't.

> I tested that the llvm and clang testsuite work. I also tested that
> printing to stdout is readable with "clang -S -o - foo.c".

I don't have a strong opinion on the changes, but it does seem rather
strange to me. The rule of thumb I've always followed is: if it's text
output meant to be read on the host platform, set the text flag. But I
don't see any wide-spread harm, aside from breaking tools which
display this text output using the Edit Control class on Windows (so
things like Notepad.exe), which usually aren't serious code editors
(because they can't do a lot of code editor-like things, such as
syntax highlighting). But since notepad.exe is so handy for looking at
small, textual things, I'm loathe to not leave users without a choice.

Let me ask this: what's the harm in allowing text output as we've been doing?

~Aaron




More information about the llvm-commits mailing list