[patch] Always open files in binary mode

Alp Toker alp at nuanti.com
Sun Feb 23 22:46:20 PST 2014


Hi Rafael,

This makes a lot of sense. Supporting the Windows text mode flag only 
ever caused bugs that were difficult to detect where F_Binary was 
mistakenly omitted.

Furthermore if we do ever want to write out CRLFs, we'll want to do it 
explicitly by writing out '\r\n' instead of relying on the Windows 
feature given that it introduces byte offsets that break seek/fseek.

Your patch includes context for the cases where F_Binary was removed, 
but what'd be more interesting is to see the raw_fd_ostream uses that 
_were_ previously operating in text mode whose functionality will change 
following your patch. Do you have an idea which (if any) uses are still 
in text mode?

Alp.



On 24/02/2014 02:25, Rafael EspĂ­ndola wrote:
> It looks like everything on windows these days can handle unix line endings.
>
> I tested that the llvm and clang testsuite work. I also tested that
> printing to stdout is readable with "clang -S -o - foo.c".
>
> Cheers,
> Rafael
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-- 
http://www.nuanti.com
the browser experts




More information about the llvm-commits mailing list