[cfe-commits] r150128 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaCXX/function-extern-c.cpp

Aaron Ballman aaron at aaronballman.com
Thu Feb 16 18:21:21 PST 2012


2012/2/16 Rafael Espíndola <rafael.espindola at gmail.com>:
>> I don't think it's been finding false positives, actually.  I think
>> the real problem is that there's no way for the programmer to specify
>> their intentions.
>
> One false positive was in a (strange, ABI dependent) code in firefox.
> The javascript engine used to be C and still has a C interface. The
> actual implementation is c++. The basic "javascript value" type is
> declared as a C or C++ type with the same layout.

Can you give me an example of what that type looks like?

> The code should probably be changed to use a C type on the interfaces
> and have a implicitly constructed c++ type that wraps it, but that
> would be a massive change to the codebase, so I had to disable this
> warning for us too.

Yeah, it's a bummer that the only way to suppress this is to either
disable the warning entirely, or to use a #pragma to do it on a case
by case basis.  There's no way to flag the declaration of the type as
being fine for C linkage...

~Aaron




More information about the cfe-commits mailing list