[LLVMbugs] [Bug 8527] New: Win32/Process.inc: "NUL" is not display device(opt -o nul fails)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 2 01:04:06 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8527

           Summary: Win32/Process.inc: "NUL" is not display device(opt -o
                    nul fails)
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: System Library
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: geek4civic at gmail.com
                CC: llvmbugs at cs.uiuc.edu


$ Release+Asserts/bin/opt.exe a.ll -o nul
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

===

Also NUL is character device. GetFileType(h) cannot distinguish whether h is
console handle or not.

Proposal patch;

--- a/lib/System/Win32/Process.inc
+++ b/lib/System/Win32/Process.inc
@@ -132,7 +132,8 @@ bool Process::StandardErrIsDisplayed() {
 }

 bool Process::FileDescriptorIsDisplayed(int fd) {
-  return GetFileType((HANDLE)_get_osfhandle(fd)) == FILE_TYPE_CHAR;
+  DWORD Mode;  // Unused
+  return (GetConsoleMode((HANDLE)_get_osfhandle(fd), &Mode) != 0);
 }

 unsigned Process::StandardOutColumns() {

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list