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.

Assembler doesn't like unary casting of a float computation in define statement

Hello

If I have a # define statement as given below, the preprocessor does ok for the 'C' code and the compiler compiles clean. But in assembler, the same header file if included causes problems. I wish a simple unary cast in #define's  should be honoured (and can easily be honoured - as it is resolved cleanly) to make our life easy. Otherwise, I have to remove the casting in the #define statement and include a casting in all places in 'C' code. But if I need to change from int16 to int32 at a later date, I have to scan all over my program.

In assembly, of course I have to use $cvi(). Does $cvi() works fine for both int32 as well as int16?

#define MY_INT_VAL  (int16)(275.25 * 105.34)

 Thanks

Sayee

  • This seems like a reasonable request, but it's probably not going to be easy to implement.  I've added enhancement request SDSCM00039512 for this issue.

    $cvi produces a 32-bit value regardless of the architecture, so yes, it will work for 32-bit values.