[poppler] [PATCH] Clang++ plugin that checks GooString::format-like calls

Albert Astals Cid aacid at kde.org
Mon Feb 17 13:31:42 PST 2014


El Dilluns, 17 de febrer de 2014, a les 00:26:44, Fabio D'Urso va escriure:
> Hi,
> 
> The clang plugin that checks for GooString::format usage errors is
> (finally!) ready. o/

Awesome, which clang did you use to write this?

I'm on 3.4 and get

goostring-format-checker.cc:24:46: error: unknown template name 
'RecursiveASTVisitor'
class GooStringFormatCheckerVisitor : public 
RecursiveASTVisitor<GooStringFormatCheckerVisitor> {
                                             ^
goostring-format-checker.cc:340:11: error: no member named 'TraverseDecl' in 
'<anonymous>::GooStringFormatCheckerVisitor'
                visitor.TraverseDecl(ctx.getTranslationUnitDecl());
                ~~~~~~~ ^
2 errors generated.

Cheers,
  Albert

> 
> It goes through each call to GooString::format, GooString::appendf or error,
> and it checks that the extra arguments match the format string.
> 
> In order to run it, you need to compile the plugin, set CXXFLAGS accordingly
> and compile poppler with clang++. It's explained in detail in the README
> file.
> 
> The 0002 patch fixes some minor issues spotted by the tool.
> 
> Fabio



More information about the poppler mailing list