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.

Remark #880-D

Hello,

i'm getting a lot of warning #880-d paramter "xx" was never refrenced. In many cases it is correct that the parameter is not referenced, but i cant't change the code.

Is it possible to suppress these warnings local (where i want it /not in a global way)?

Kind regards Ralf

  • Ralf Rink said:
    Is it possible to suppress these warnings local (where i want it /not in a global way)?

    Yes.  There are pragmas you can use.  There are 2 ways to go about it.  Use the one you prefer.

    I notice from your other posts that you use the C2000 compiler.  So that is the one I use in the examples below.

    Here is an example that gets two remarks for the argument not_used.

    /* file.c */
    int f1(int used, int not_used)
    {
       return used + 1;
    }
    
    int f2(int used, int not_used)
    {
       return used + 2;
    }

    Building with these options shows the diagnostics and their identifying number ...

    >>>>cl2000 --issue_remarks --display_error_number file.c
    "file.c", line 2: remark #880-D: parameter "not_used" was never referenced
    "file.c", line 7: remark #880-D: parameter "not_used" was never referenced

    One method is to use the pragmas diag_suppress and diag_default ...

    /* file.c */
    #pragma diag_suppress 880
    int f1(int used, int not_used)
    {
       return used + 1;
    }
    #pragma diag_default 880
    
    int f2(int used, int not_used)
    {
       return used + 2;
    }

    Now the first diagnostic is suppressed ...

    >>>>cl2000 --issue_remarks --display_error_number file.c
    "file.c", line 9: remark #880-D: parameter "not_used" was never referenced

    The other method is to use the pragmas diag_push, diag_suppress, and diag_pop ...

    /* file.c */
    #pragma diag_push
    #pragma diag_suppress 880
    int f1(int used, int not_used)
    {
       return used + 1;
    }
    #pragma diag_pop
    
    int f2(int used, int not_used)
    {
       return used + 2;
    }

    Building also shows only one diagnostic ...

    >>>>cl2000 --issue_remarks --display_error_number file.c
    "file.c", line 10: remark #880-D: parameter "not_used" was never referenced

    Please read more about these pragmas in the C2000 compiler manual.

    Thanks and regards,

    -George

  • You can also use attribute "unused":

    /* file.c */
    int f1(int used, int not_used __attribute__((unused)))
    {
       return used + 1;
    }
    
    int f2(int used, int not_used __attribute__((unused)))
    {
       return used + 2;
    }
    
  • Hello,

    i'm using __attribute__((unused)) to surpress my warnings and it works well.

    I've got some remarks of type "#2142-D comparison between signed and unsigned operands" and surpress them with

    #pragma diag_suppress 2142
    ...
    #pragma diag_default 2142

    Further on i get remark "#1463-D Link-time optimization is disabled for this file due to the use of inline assembly".

    Is there also a possibility to supress both remarks with __attribute ... or something similar?

    Kind regards Ralf
  • Not to my knowledge. You can suppress these remarks with a command line option like --diag_suppress=1463