some clang plugins report bogus warnings
sbergman at redhat.com
Wed Jul 30 07:33:03 PDT 2014
On 07/30/2014 04:15 PM, Lubos Lunak wrote:
> On Tuesday 29 of July 2014, Michael Stahl wrote:
>> On 29/07/14 01:39, V wrote:
>>> The only thing bugging me is that the extern-and-not-defined plugin is
>>> not really werror compatible because it seems to warn in a lot of
>>> places. To disable it I moved into a "disabled" folder and told git to
>>> ignore it so I dont commit that changed, but it seems to reappear
>>> everytime I pull.
>> interesting ... i've had the same problem with 2 of the clang plugins;
>> at least with the clang packages on Fedora 20, they report warnings in
>> _header_ files despite the plugins having a check that the offending
>> statement "isInMainFile()" - perhaps it's some clang bug that does not
>> occur with the clang versions the authors of the plugins used? well
>> there is macro expansion involved in the problems i saw, argh...
> I think the call to isInMainFile() should not use spellingLocation, but just
> the location given by functionDecl->getLocation() .
I had the faint recollection that old
clang::SourceManager::IsFromMainFile did require its SourceLocation
argument to actually be a spelling location, and would otherwise trigger
an assert in assert-enabled Clang builds. But I right now finished a
build against old Clang 3.3 of full LO "make check" including
"fix for running externandnotdefined plugin on Ubuntu" (i.e., no longer
using spellingLocation) and at least that succeeded, so my memory may
well be wrong.
More information about the LibreOffice