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.

Migrating from CCSv3 to CCSv6 compilation error

Other Parts Discussed in Thread: CCSTUDIO

I am also trying to migrate from CCS v3.3 to CCS V6 and have the following compilation problems.

1. getting an error with CCSv6, but not with CCSV3.3 with this line of code:

line: int32 test = (int32((8192.0*262144)-1)

error:  line 34: error #175: floating-point value does not fit in required integral type

Does anyone know how to fix?  Is this a MISRA error?

 

Thanks,

Saskia

  • I cannot explain what is occurring based on what I see here.  Please submit a test case which I can compile and see this error for myself.  It does not need to run.  One easy way to do it is to preprocess the source file which contains this line.  I also need to know the compiler (not CCS) version and the exact compiler build options used.

    Thanks and regards,

    -George

  • Here is my example project (contains the compiler options) located in C:\Test.  0410.Test.zip

    The compiler version I believe is c2000_6.2.7

    Here is the output from the compile.

    'Building file: ../Source/Test_Src.c'

    'Invoking: C2000 Compiler'

    "D:/ti/ccsv6/tools/compiler/c2000_6.2.7/bin/cl2000" -v28 -ml --include_path="D:/ti/ccsv6/tools/compiler/c2000_6.2.7/include" --include_path="/packages/ti/xdais" -g --define="_DEBUG" --define="LARGE_MODEL" --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Source/Test_Src.pp" "../Source/Test_Src.c"

    "../Source/Test_Src.c", line 8: error #175: floating-point value does not fit in required integral type

    "../Source/Test_Src.c", line 12: warning #552-D: variable "temp" was set but never used

    1 error detected in the compilation of "../Source/Test_Src.c".

  • I forgot to put in the CCS V3.3 output:

    [Test_Src.c] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -g -fr"C:/Test/Debug" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../Debug.lkf" "Test_Src.c"
    "Test_Src.c", line 12: warning: variable "temp" was set but never used

     

  • Thank you for submitting a test case.  I can reproduce your results.  

    I cannot explain why the compiler issues that diagnostic.  So, I submitted SDSCM00050807 to the SDOWP system.  Feel free to follow it with the SDOWP link below in my signature.  One of two things may happen.  One, this will be confirmed as a bug and fixed in a future release.  Or two, it is determined this is not a bug, in which case an explanation of why a diagnostic is needed will be supplied.

    Thanks and regards,

    -George

  • This case hinges on floating-point rounding of IEEE-32 values.  This issue is still under investigation.  In the meantime, you can avoid the rounding issue by using 64-bit long double arithmetic:

    int32 test = (int32((8192.0L*262144)-1)
  • Thanks I will use the work around.  Other changes are being made to the module anyhow.

     

  • Hi,

    Was this issue fixed? I'm having the same problem.

    error #223: floating-point value does not fit in required floating-point type

    On many cases my values will not fit in the float type, but I was expecting to get a rounded value in the float type (like others compilers), instead of getting a compilation error.

    I also tried to suppress this error #223 with the --diag_warning=225, but without success. Is there any workaround?

    Regards,