Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] C/C++ static analysis

Hi All,

 

            I am extending TPTP C/C++ static analysis to add my own rules for C. TPTP C/C++ static analysis work fine with C++, but don't work with C. The problem was asked on the mailing list, refer http://dev.eclipse.org/newslists/news.eclipse.tptp/msg03699.html and there it is told that CDT don't handle C++ and C in the same way.

             So I tried a workaround for this. I am using rule filters in my rules like ASTNodeTypeRuleFilter for the ASTNodeTypes - ICASTFunctionDefinition, ICASTSimpleDeclaration, ICASTFunctionCallExpression. I found that these filters do not work. I replaced the values of ICASTFunctionDefinition, ICASTSimpleDeclaration, ICASTFunctionCallExpression with the values of ICPPASTFunctionDefinition, ICPPASTSimpleDeclaration, ICPPASTFunctionCallExpression. After that the filters worked fine. I don't know the significance of the values of these variables. Is it the right way to make the rules work for C?

Please guide.

 

Regards,

Swapna


Back to the top