On Fri, Nov 14, 2014 at 4:53 PM, Samuel Yang <yangxi...@gmail.com> wrote:
--Hi all,I have a rule which is very simple, but when I integrated it into Jenkins, it caused some warnings are decreased. e.g. long line rule without my custom rule, it catches 100 warnings, but with mine, it only catches 20.I have debugged it and found it was caused by the getNameAsString. However, I have no idea why this function call breaks other rules.Have you meet this before or do you guys have any suggestion?void applyNSMakeRange(CallExpr* call){
const FunctionDecl * FD = call->getDirectCallee();//ok
const FunctionDecl *CD = FD->getCanonicalDecl();
//string functionName = CD->getNameAsString();//failed
if(functionName == "xxxx")
{
addViolation(call, this, "NSMakeRange range may be missed range");
}
}
public:
virtual const string name() const
{
return "Dangerous methods call";
}
virtual int priority() const
{
return 2;
}
bool VisitCallExpr(CallExpr* expr)
{
applyDecl(expr);
return true;
}
You received this message because you are subscribed to the Google Groups "OCLint Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oclint-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.