For EFI firmware we use x86_64-pc-win32-darwin, but the default behavior for diagnostics on this triple is to suppress column number printing, and format line numbers to be compatible with Visual Studio. This breaks our Xcode IDE, and command line yank put. Attached is my first take at a patch to fix this. IMHO the default diagnostic output for clang, should be clangs native diagnostic output that matches the documentation. I understand the need to modify the output to match the IDE that is being used, as I’m fixing that reverse problem. It would seem OK to add a flag, like -fno-diagnostic-standard-format, when clang is being used with an incompatible IDE.
test.c(2): error: unknown type name 'asdkjf'
asdkjf
^
clang -ccc-host-triple x86_64-pc-win32 ve.c -S
ve.c:2:1: error: unknown type name ‘asdkjf’
asdkjf
^
To get the old behavior you need to add the new flag:
clang -ccc-host-triple x86_64-pc-win32 ve.c -S -fno-diagnostics-standard-format
ve.c(2) : error: unknown type name ‘asdkjf’
asdkjf
^
If I was doing this from scratch I would probably add a flag per IDE that was not compatible with the clang diagnostics format that would modify the clang diagnostic output to be compatible for that IDE. So something like -fdiagnostics-ide=VisualStudio or -fdiagnostics-vi. I picked --fno-diagnostic-standard-format to better match what the currently code was doing:
if (LangOpts && LangOpts->Microsoft) {
Given I’m a novice at clang, llvm, and C++ I figured changing as little as possible was a good plan.
Andrew Fish
Patch to svn r131522.
fno_diagnostic_standard_format.patch (4.61 KB)