[cfe-dev] Visual Studio parsable error output from clang-cl
Kim
soldoutseashell at gmail.com
Sat May 3 16:31:31 PDT 2014
Hi guys,
I'm working on an extension for visual studio 2013 that will let me
compile with clang-cl and I want to have the output from clang fully
integrated into the output pane and error list. The errors I'm getting
from clang-cl look like this:
C:\Users\Kim\Documents\Visual Studio
2013\Projects\ConsoleApplication8\ConsoleApplication8\Source.cpp(5,2) :
error: use of undeclared identifier 'ohno'
While the regular VS error format looks like this:
>c:\users\kim\documents\visual studio
2013\projects\consoleapplication8\project1\source.cpp(6): error C2065:
'safsa' : undeclared identifier
And the clang error line is not parsed for the error list correctly with
ParseOutputStringForTaskItem:
while ((line = compileProcess.StandardError.ReadLine()) !=
null)
{
line = line + "\n";
uint[] priority = new uint[1];
string[] file = new string[1];
uint[] line_number = new uint[1];
string[] msg = new string[1];
int[] found = new int[1];
launchpad.ParseOutputStringForTaskItem(line, priority,
file, line_number, msg, found);
OutputPane.OutputTaskItemString(line,
(Microsoft.VisualStudio.Shell.Interop.VSTASKPRIORITY)priority[0],
VSTASKCATEGORY.CAT_BUILDCOMPILE,
"Error",
(int)Microsoft.VisualStudio.Shell.Interop._vstaskbitmap.BMP_SQUIGGLE,
file[0], line_number[0], msg[0]);
}
OutputPane.FlushToTaskList();
I get output in the output pane fine (and I can click the message to
goto source location) but nothing in the error list.
I figure that clang-cl outputs visual studio compatible error messages
by default but I just wanted to check with the experts. Maybe someone
here has already got this working.
Thanks,
Kim
More information about the cfe-dev
mailing list