[cfe-dev] clang errors vs clang_getDiagnostics

Douglas Gregor dgregor at apple.com
Tue Jan 22 11:52:54 PST 2013


On Jan 21, 2013, at 11:32 PM, Anders Bakken <agbakken at gmail.com> wrote:

> Oops. I found it. -fspell-checking. Sorry for the spam.

Right. We did this because spell-checking/typo correction can have a significant impact on performance, so we turned it off by default for libclang clients, which are likely to care more about performance.

	- Doug

> Anders
> 
> On Mon, Jan 21, 2013 at 11:25 PM, Anders Bakken <agbakken at gmail.com> wrote:
>> Hi
>> 
>> I have a problem with using diagnostics with the C API.
>> 
>> I do this on the command line:
>> 
>> main.cpp:
>> 
>> void foobar();
>> 
>> int main() {
>>  foobaz();
>> }
>> 
>> clang main.cpp
>> 
>> I get this:
>> 
>> main.cpp:4:3: error: use of undeclared identifier 'foobaz'; did you
>> mean 'foobar'?
>>  foobaz();
>>  ^~~~~~
>>  foobar
>> main.cpp:1:6: note: 'foobar' declared here
>> void foobar();
>>     ^
>> 1 error generated.
>> 
>> If I do the same thing with clang_parseTranslationUnit and then
>> clang_getDiagnostic I don't seem to get this suggestion. I just get:
>> 
>> error: use of undeclared identifier 'foobaz' [2, Semantic Issue]
>> 
>> Do I need to pass a switch that is on by default for clang itself?
>> 
>> regards
>> 
>> Anders
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list