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.

Enable / disable optional errors?

Hi,

I have a project using CCS6.1that has been building fine with no errors.  However, today three errors are generated, but it creates the output file successfully.  The errors are for assigning a variable to itself (x = x;) and the error icon is not the usual icon, it is what appears to be a red bug (see image below).

 

I checked the MISRA options, but none are enabled...is there another place where additional error conditions can be enabled?  I'm wondering if someone in my group inadvertently turned some on.

 

Thanks,

David

 

  • I see errors like this is in multiple projects that all used to build without error.  What I have found is that for some projects, closing and re-opening the projects cause the errors to go away, but that doesn't work for all projects.

     

    We recently updated to CCS6.1, I wonder if that is the source of the issue.  If I start from a clean workspace I don't see the issue.  Perhaps there was a conversion issue when the workspace was created under CCS6.0 and then used in 6.1.

     

    David

  • David,

    This is coming from the built-in code analysis tool. Check this wiki section: 
    http://processors.wiki.ti.com/index.php/Projects_and_Build_Handbook_for_CCS#Code_Analysis

    The settings here can be set at workspace level or project level. Sounds like the error check for "Assignment to itself" was not previously enabled but is enabled now. I'm not sure if the CCS update could have changed the default setting, but hopefully this at least explains where this is set and how to disable it.

  • Thanks. This could be very useful. Is there an overall enable / disable for it? I see many of the checkboxes checked, but I know there is code that breaks the rules, but we don't get the error / warning that it corresponds to.
  • David Sabol said:
    Is there an overall enable / disable for it? I see many of the checkboxes checked, but I know there is code that breaks the rules, but we don't get the error / warning that it corresponds to.

    By default, this is disabled for CCS projects. If you go into Project Properties for a CCS project, then to C/C++ General->Code Analysis->Launching, you will see that the "Run with build" and "Run as you type" boxes are unchecked. However, I found that if I select Code Analysis in the left pane, and click OK, then it turns on the checks for that project. Maybe something like that happened inadvertently for that one specific project you are working with.

    Once it is turned on for a project, the following steps can turn it off again:

    Clean out the Problems view and then Refresh the project. To clean out the Problems view, highlight and select all the messages in the Problems view and hit delete. Then close the source file from the editor view. Right-click on the project and click Refresh. Then open the source file again and the errors should be gone.

    Let us know if this is helpful. I will also update that wiki page with this additional information.

  • This was very helpful, thanks!