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.

TMS320F28075: Warning: 1107-D conversion from integer to smaller pointer

Part Number: TMS320F28075

Hi team,

I am getting this warning in CLA, any comments on how to eliminate this warning?

Warning: 1107-D conversion from integer to smaller pointer

#define CLA_RUN_FUNCTION                    *(volatile float*)0x000087F8

#define CLA_RUN_PREVIOUSFUNCTION           *(volatile float*)0x000087FA

 

__interrupt void Cla1Task1 (void)

{

    CLA_RUN_PREVIOUSFUNCTION = CLA_RUN_FUNCTION;

    CLA_RUN_FUNCTION = 0x0001;

   ……

}

Regards,

Brian

  • Brian,

    Brian Wang0 said:

    #define CLA_RUN_FUNCTION                    *(volatile float*)0x000087F8

    #define CLA_RUN_PREVIOUSFUNCTION           *(volatile float*)0x000087FA

    why do you have it "volatile float"? shouldn't it be "volatile int"

  • Santosh,

    Changed to INT but warning still exists.

    Could you help to try on your side? I believe you should see the same thing.

    Regards,

    Brian

  • Brian,

    On CLA,  the type of constant is 32-bits (same as int) and the type of a pointer is 16-bits.  So a narrowing conversion occurs, and the compiler warns you about it.

    Try something like below.

    #define CLA_RUN_FUNCTION                  (*(volatile unsigned long *) (uintptr_t)0x000087F8)
    #define CLA_RUN_PREVIOUSFUNCTION          (*(volatile unsigned long *) (uintptr_t)0x000087FA)
    
    
    
        CLA_RUN_PREVIOUSFUNCTION = CLA_RUN_FUNCTION;
        CLA_RUN_FUNCTION = 0x0001;