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.

Compiler: MISRA 12.6 violation incorrectly assigned

Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

c2000 compiler 18.1.1.LTS and C2000Ware_1_00_04_00

Using blinky example for CPU1 for F2837xD control card

In F2837xD_SysCtrl.c

If I have MISRA checking enabled for only section 12.6 in this SysCtrl file, I get some lines that violate 12.6.  Some are actually violating 12.6, and some I think are incorrectly interpreted as violating 12.6.

Specifically,

// line 630
ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = divsel;
// line 851
WdRegs.WDCR.all = WDCR;
// line 882
ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV = divsel;

#1483-D (MISRA-C:2004 12.6/A) Expressions that are effectively Boolean should not be used in operations with expressions that are not effectively Boolean

where it seems nothing boolean is going on here.

  • Thank you for reporting the problem, and sending in the relevant details.  I can reproduce those diagnostics, and others like them.  The entry CODEGEN-4617 is already filed in the SDOWP system about this issue.  I added your test case to it.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George