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.

how to suppress all warnings with pragmas



Hi,

I'm trying to use pragmas to disable all warnings for a particular section of code.  I'm using ti-cgt-arm_20.2.5.LTS.

I also want to suppress specific warnings (which I know there are many threads on) but it would be useful to have a reference of warning and error numbers.  Is this published anywhere?

#pragma diag_push
#pragma diag_suppress [what goes here?]

// code block

#pragma diag_pop

  • The typical method ... Build that block of code with no #pragmas.  Use the build option --display_error_number.  This causes each diagnostic to include an ID number, similar to ...

    "file.c", line 7: warning #112-D: statement is unreachable

    Suppose your block of code gets that diagnostic, and you want to suppress it.  This #pragma is one way to suppress it ...

    #pragma diag_suppress 112

    Notice how the number 112 comes from the diagnostic.  For all the details, please search the TI ARM compiler manual for the sub-chapter titled Understanding Diagnostic Messages.

    Thanks and regards,

    -George

  • This isn't really the question I asked.  I want to know how to suppress all warnings for a given code block, not a specific one.  The comment about also wanting specific warning suppression was just to ask if there's a published list of them somewhere.

  • The entry EXT_EP-9948 has already been filed to request that a list of all the possible diagnostics be made available.  Unfortunately, it has not been completed.  I will add your request to it.  Note this request will be logged in a part of the entry that is not publicly available, so you will not see any change in the public view of the entry.

    Thanks and regards,

    -George

  • Thank you.  Any idea about original question?

  • Unfortunately, there is no #pragma, or anything similar, which suppresses all warnings.  The closest possible solution is the command line option --no_warnings.  If your code is organized as a CCS project, you could use File Specific Options to apply --no_warnings to just one file.

    Thanks and regards,

    -George