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.

Unexplained compiler error under CCS12 for code that used to compile under CCS3.3 ?!?

Other Parts Discussed in Thread: TMS320C5515

Hi,

This question I have relates mainly to the new CCS12 environment I am using, with an imported project dating from the days of CCS3.3 Platimun.

I am not entirely sure what could be the difference in compilation under CCS12 as opposed to the compilation of the code under CCS3.3, but the following line of code returns an error under CCS12 whereas it was comipling perfectly fine under CCS3.3 using the same compiler version:

(TSK_isTSK()) ? TSK_sleep(TSK_SLEEP_15MS) : wait(150000);    // Wait for about 15ms.

The error returned refering to the above line is : line 277: error #32: expression must have arithmetic type

This line used to compile without any issues under CCS3.3.

Changing the above line to : 

if(TSK_isTSK())
       TSK_sleep(TSK_SLEEP_15MS);
else
       wait(150000);

does not return an error. For some reason, it would appear the compiler complains about the TSK_sleep(TSK_SLEEP_15MS) section of the above ternary expression ?!?

The compiler I'm using is v4.4.1, and the DSP/BIOS version is 5.42.2.10.

The code is being compiled for a TMS320C5515/05 device.

I am wondering what is different now that I'm compiling under CCS12 ? Any suggestions would be appreciated.

Regards, Mike

  • Please add the build option --verbose_diagnostics and build again.  This causes the compiler to echo the source line associated with a diagnostic, with a marker which indicates where on the line the error starts.  Sometimes, this makes it easier to understand the cause of the error.

    If that doesn't resolve the problem, then for the source file that sees ...

    line 277: error #32: expression must have arithmetic type

    ... please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • Hi George,

    I added the build option as suggested and recompiled the code. Same error as before and there's no extra detail on where on the line the error starts ;-(

    But if I compile the following line, the project compiles without errors.

    (TSK_isTSK()) ? wait(150000) : wait(150000);

    So it would appear the TSK_sleep(TSK_SLEEP_15MS) function call causes the compiler error. BTW this function/macro expands to : (SEM_pend(&TSK_timerSem, 5))

    Why should this call to SEM_pend() cause a problem ?

    Thanks, Mike

  • Why should this call to SEM_pend() cause a problem ?

    To understand that, I need to reproduce the problem.  Please submit the test case I requested in my last post.

    Thanks and regards,

    -George

  • Hello again George,

    I had a look at the case submition process you refered to and it looks a bit time consuming for the issue I am having with the ternary operator when compiling.

    I was hoping this test could be performed on any CCS12 PC platform set-up with the TI V4.1.1 compiler and the DSP/BIOS version 5.42.2.10.

    So anyways after having looked further at some of the compiler options, I did try out the compiler option Relaxed parsing - (non-strict ANSI) and now it compiles no problems. So it may have been the case that this is what was being used under CCS3.3 compilation but the migration from one to the other did not take this into account and I used the default value ... So anyways now I will check to see if it executes correctly ...

    So what is this default mode (unmarked) for the "Language Settings" equivalent to, if the other two are strict ANSI and non-strict ANSI as the other options ?

    Regards, Mike

  • what is this default mode (unmarked) for the "Language Settings"

    Please search the C55x compiler manual for the sub-chapter titled Changing the ANSI/ISO C Language Mode.

    Thanks and regards,

    -George

  • Hi George, thanks ok that should be fine.