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.

  • Resolved

Compiler: C2000 warnings #112 and #187 (unreachable code) issued for templated code

Tool/software: TI C/C++ Compiler

I'm seeing plenty of warnings #112 and #187 in templated code.

It is true that the code is unreachable for the template instances the warnings are issued for, however this is not true for all possible sets of template arguments.

I think unreachable code warnings should only be issued for code that is unreachable independent of template arguments. The whole point of templates for me is to provide abstractions that the compiler can see through and throw away.

  • You can control whether these diagnostics are emitted.  One method is to use the build option --diag_suppress=112.  Please see more details in the section titled Understanding DIagnostic Messages in the C28x compiler manual.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    I don't want to suppress the warnings, I just want them to make more sense. I have attached some code that demonstrates my issues:test.cpp

  • In reply to Dominic Fandrey:

    Thank you for the test case.  I used it to file CODEGEN-4153 in the SDOWP system to have this looked at.  It is not filed as a defect, but as an enhancement request.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Thanks!

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.