Disable individual SHARC compiler warnings

SC58x family

CCES 2.8.1

Is there a way to disable a specific compiler warning within the C code?

For example, is there a way to disable the "No break at the end of case" warning on a case by case basis (pun intended).

In Lint, I would add "//lint -fallthrough" before the next case statement.

Parents Reply
  • 0
    •  Analog Employees 
    on May 9, 2019 9:46 AM in reply to DFitzpatrick187


    You can use the following syntax to disable the warning for particular function

    #pragma diag(push)
    #pragma diag(suppress:1080)

    // Your function

    #pragma diag(pop)

    #pragma diag takes two arguments and an optional third argument. Each argument is separated by a ":". The first argument must be the identifier suppress, warn, or remark. When MISRA is not enabled, the second argument is the error number in the format of number without any preceding "cc" or zeros. The error must be a discretionary error. When MISRA is enabled, the second argument is of the format misra_rule_9_6, where the "9_6" refers to rule 9.6 of the MISRA-C:2004 Guidelines.

    Santha kumari.K