[LLVMbugs] [Bug 8160] New: driver.cpp: captures the object DiagnosticOptions on stack

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 15 20:05:45 PDT 2010


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

           Summary: driver.cpp: captures the object DiagnosticOptions on
                    stack
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: geek4civic at gmail.com
                CC: llvmbugs at cs.uiuc.edu


tool/driver/driver.cpp:288 in main(),
  TextDiagnosticPrinter *DiagClient
    = new TextDiagnosticPrinter(llvm::errs(), DiagnosticOptions());

DiagnosticOptions() is on stack.
It causes unexpected behavior.

On one of my environments, cygwin-1.5, diagnostic outputs are wrapped by a few
columns, to let test/Driver/Xarch.c fail. (due to bogus MessageLength)


[My workaround]
  TextDiagnosticPrinter *DiagClient
    = new TextDiagnosticPrinter(llvm::errs(), *new DiagnosticOptions());

-- 
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