This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CODAN & CCS

I was playing around today and saw that eclipse has a decent static analysis tool built in.  After playing around with CCS (v5.2) I found that Codan is in fact included with the default installation, but it is hidden away by the CCS project navigator.  Is there any plan to add the "Run C/C++ Code Analysis" option to the right click menu in the CCS project navigator?  It seems like this would be pretty easy to do and would give us static code analysis tools for free in CCS.

Trey

  • Trey,

    AFAIK Code Analysis is enabled by default... I see them enabled in the workspaces I have for the CCSv5.1/5.2 versions: menu Window --> Preferences --> C/C++ --> Code Analysis.

    Do you mean a different analyzer?

    Regards,

    Rafael

  • Oh, I guess it is.  I wasn't getting any warnings so i assumed it was turned off, but I guess my code just didn't have anything that set off the analyzer.  I tried making a new workspace and did an assignment instead of a equality and it caught it.

    This is a really nice feature, we should market it more to customers.

    Trey

  • Hi, Trey,

    In CCS v5.2, you can enable Code Analysis to run with builds, or as you type (for some checkers), or both. That's set in a project's Properties. Before setting it to run with builds, nothing from Code Analysis showed up in my Problems windows, just the warnings & errors that the compiler generated. The setting for the selected project is at Project -> C/C++ General -> + Code Analysis -> Launching. (If you don't see the C/C++ General selection on the Properties dialog, click on Show Advanced settings.)

    I had no idea that we had that many case statements without breaks.

    It appears pretty flexible, too: on the C/C++ General -> Code Analysis page, you choose whether a project uses the workspace settings that are under Windows -> Preferences, or uses settings that are specific to that project.

    I'll agree that Code Analysis could be easier to turn on & off. But it's great that it's there! It and the MISRA checks are great features in CCSv5.

    Regards,

    John