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.

TDA4VE-Q1: Error: this assembly directive potentially unsafe inside a function

Part Number: TDA4VE-Q1

Tool/software:

Hi ,

I am trying to add the below assembly code in c7x , hook function, but when i try to compile the same, i get the error stating that " Error: this assembly directive potentially unsafe inside a function "

 __asm volatile("RETE .S1 A0,A1");

hook function is called inside the c7x exception handler.

Regards,

Manojna

  • Please change the line to ...

    __asm(" RETE .S1 A0,A1");

    The volatile keyword is removed because it is not supported.  Please search the C7000 compiler manual for the sub-chapter titled GNU and Clang Language Extensions.  The table in that sub-chapter shows that the GCC extension named Extended asm is not supported.  This is the language extension that includes, among other things, applying volatile to __asm statements.  

    The string must start with a space.  Without that space, RETE is viewed as a label, and .S1 is viewed as a directive.

    Thanks and regards,

    -George