I've believe I've found a bug. When piping data from one command to another stdin defaults to non-binary. This can destructively alter the data being passed. The fix on unix/llinux is to reopen stdin as binary using freopen(). However in MinGW it fails with the error "No such file or directory"
I'm attaching three demo programs to thoroughly show the bug. Each is commented at the top.
I belive I'm using the current version of MinGW
C:\MinGW\forest\Bin-Stdin>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC)
C:\MinGW\forest\Bin-Stdin>ld -v GNU ld (GNU Binutils) 2.22
Mirosoft Windows XP SP3 cmd.exe shell included in the OS
Log in to post a comment.