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.

TMS570 Compiler question

Other Parts Discussed in Thread: TEST2

I'm duplicating this question received originally on the TMS570 ARM® Cortex-R4F Transportation and Safety MCUsForum.


Regards,

Jean-Marc

 

Hi,

I'm not sure if this is the correct forum but I am seeing this problem on the TMS570 using CCS code generation toold V4.6.3.

I have some code where I want to validate a parameter that is a function pointer. I am getting an "operand types are incompatible" warning message even though the types are the same. Here is an example that highlights the problem:

int test(void);

static void test1(void);

 

 

static void test2(void);

int test(void)

{

    int i = 0;

    if(&test1 > &test2) /* Warning on this line */

    {

        i = 1;

    }

    return i;

}

static void test1(void) { }

static void test2(void) { }

 

 

  • Technically the C standard does not allow relational comparisons of function pointers, thus the warning.  You can add casts to integer types or use the command-line option -pds43 to silence the warning, but the code will still not be strictly conforming.