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.

TMS Compiler v4.9.2

I am using TMS Compiler v4.9.2  for TMS 570 device .

In one file i have function declared as 

void func(U32 const *const data);

and in the function call am passing a different data type "sum" and typecasting it to U32 *

func( (U32 *) &sum);

When i tried to compile the above line of code i get compilation error as follows

line 209: error #169-D: argument of type "U32 *" is incompatible with parameter of type "const U32*const"

I compiled the same code on a different compiler (also the micro controller is different and not TI one) it compiles ? May i know which one is correct here ?
  • To clarify more the function prototype is

    void func(COMMAND_TYPE const *const data);

    where
    typedef U8 COMMAND_TYPE[COMMAND_LENGTH];

    and in the function call am passing func( (COMMAND_TYPE *) &sum);

    When i tried typecasting func( (const COMMAND_TYPE *) &sum); the compiler passed with no errors.
  • Hi Omprasad,

    Sorry I don't know the answer to this. Also I think it depends on U8 and U32 which themselves are probably in header files.

    If you have compiler trouble - there is a compiler forum e2e.ti.com/.../

    But this seems to be a generic C programming issue nothing compiler specific - so you might start w. a C language reference.

    This forum is mainly for technical support specific to Hercules.