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 can I tag a function as "noreturn"?

Hi,

I'm using an UNREACHABLE() macro that invokes a custom assert function.

This assert function is defined with the noreturn attribute.

#define UNREACHABLE() bsp_on_assert(__LINE__)
void __attribute__((noreturn)) bsp_on_assert(int line);

The problem: it looks like CCS ignores the attribute and throws a warning.

How can I define a UNREACHABLE macro using CCS?

Code Composer Studio: Version: 12.6.0.00008

Compiler: TI v20.2.7.LTS

Regards,

Gabriel

  • Please rebuild the entire project.  One way to do that is to right-click on the name of the project and select Rebuild Project.  Then save the contents of the Console (not Problems) view to a text file.  Use the icon named Copy Build Log (older versions of CCS) or Save build log to file (newer versions of CCS).  When you name the log file, be sure to use the file extension .txt.  Please attach that text file to your next post.

    Thanks and regards,

    -George