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.

TMS320F28335: Warning for missing break in switch/case

Part Number: TMS320F28335


Tool/software:

Hi,

Digging into a project, I saw a few missing "break"s in switch/case, but the code compiles w/o warnings/errors.

The project uses the compiler v20.2.2 LTS, but the latest version I have installed, v22.6.2 LTS, doesn't issue warnings/errors either.

So, how to turn on these/such warnings?

Thanks in advance,

Tenko Yavashev

  • Hi Tenko,

    I have assigned this thread to a compiler expert. Hopefully they can provide info on if there are any available options to provide additional warnings in your case.

    Thanks,

    Ricky

  • how to turn on these/such warnings?

    Unfortunately, the compiler does not support issuing a diagnostic in this case.

    Perhaps other static code analysis tools, not from TI, can be configured to find ...

    missing "break"s in switch/case

    Thanks and regards,

    -George

  • Hi George,

    This is so weird. 

    Have you seen my reply to Ricky:

    "...

    I forgot to mention that I'm using CCS v.12.8.1.

    As you probably know, there is a switch for these Warnings/Errors in both Project and Workspace Settings>C/C++ General>Code Analysis>Potential Programming Problems>No break at end of case. Both in Project and Workspace Settings are checked, i.e. turned ON. But still no warnings.

    ..."

    So, you say that even if these switches exist, they do not function as intended?

    Best Regards,

    Tenko

  • The C code you write is turned into an executable binary file by the compiler cl2000.  These ...

    a switch for these Warnings/Errors in both Project and Workspace Settings>C/C++ General>Code Analysis>Potential Programming Problems>No break at end of case

    ... may appear to be settings related to cl2000.  But they are not.  Instead, they are settings related to a different feature of CCS called Code Analysis.  Unfortunately, I know very little about this feature.  I have changed responsibility for this thread over to experts who can help.

    Thanks and regards,

    -George

  • As you probably know, there is a switch for these Warnings/Errors in both Project and Workspace Settings>C/C++ General>Code Analysis>Potential Programming Problems>No break at end of case. Both in Project and Workspace Settings are checked, i.e. turned ON. But still no warnings.

    Please note that this is in regards to the CODAN (CODe ANalysis) feature that comes with Eclipse CDT:

    https://software-dl.ti.com/ccs/esd/documents/users_guide_12.8.0/ccs_project-management.html?highlight=code%20analysis#code-analysis

    As mentioned in the above article, we recommend that CODAN is disabled due to the numerous false positives reported when working with typical CCS project for TI devices. Hence CODAN is disabled by default.

    But if you do want to use it anyway:

    Both in Project and Workspace Settings are checked, i.e. turned ON. But still no warnings.

    Did you explicitly enable the required checkboxes? Again, check the above link for details on the specific checkboxes. Specifically the part:

    To confirm that code analysis is disabled, go to Project Properties → C/C++ General → Code Analysis → Launching, and observe that the “Run with build” and “Run as you type” boxes are unchecked.

    Thanks

    ki