r207319 - libclang: remove 'CXDiagnostic_Remark'

Alp Toker alp at nuanti.com
Mon Apr 28 02:11:59 PDT 2014


On 28/04/2014 09:29, Tobias Grosser wrote:
>
> I do not yet see the backward compatibility issues and do also not 
> understand your proposed solution. Let's try to sort this out in the 
> patch review. 

Hi Tobias,

I'll explain the backward compatibility issue here instead of digging up 
the old thread.

The problem is that it breaks almost any application using 
clang_getDiagnosticSeverity(). In our applications using libclang it 
caused some to segfault and the rest to report errors when there were none.

Here's an illustration of the typical usage of this interface from 
tools/c-index-test/c-index-test.c:

static int checkForErrors(CXTranslationUnit TU) {
...
     if (clang_getDiagnosticSeverity(Diag) >= CXDiagnostic_Error) {
       DiagStr = clang_formatDiagnostic(Diag,
clang_defaultDiagnosticDisplayOptions());
       fprintf(stderr, "%s\n", clang_getCString(DiagStr));
       clang_disposeString(DiagStr);
       clang_disposeDiagnostic(Diag);
       return -1;
     }
...
}

Alp.

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list