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.

Compiler/TMS320F28069M: Handling of Boolean expression in denominator

Part Number: TMS320F28069M

Tool/software: TI C/C++ Compiler

Hi,

using the ti-cgt-c2000_15.12.1.LTS we are seeing the following behavior for the code

#include <stdbool.h>

 

enum {

    test_variable = 1/(sizeof(uint16_t)==1)

};

It will fail with "enumerator value is not an integer constant". However this code should compile. In comparison the following code compiles fine:

#include <stdbool.h>

 

enum {

    test_variable = 1/(true)

};

Is there a newer C2000 CGT that fixes this issue?

Thanks,

--Gunter

  • Hi,

    I also wanted to show the compiler switches being used.
    “-v28 -ml -mt -O2 -g” and with or without --c99 applied

    Thanks,
    --Gunter
  • I'm sorry, I cannot reproduce the problem. Are you sure those are the only command-line options being used? Could you please cut-and-paste the entire test case and the build console to this thread?
  • Here's a thorough list of the arguments. 

    /opt/ti/ccsv6/tools/compiler/ti-cgt-c2000_15.12.1.LTS/bin/cl2000 --obj_directory=${output_dir} --obj_extension=o  --preproc_with_compile --preproc_dependency=${basename}.d -v28 -ml -mt -O2 --advice:performance=all -g --define=FLASH --define=FAST_ROM_V1p6 --issue_remarks  --diag_suppress=112 --diag_suppress=129 --diag_suppress=179 --diag_suppress=303 --diag_suppress=112 --diag_suppress=179 --diag_suppress=303 --diag_suppress=230 --diag_suppress=270 --diag_suppress=880 --diag_remark=1181 --diag_remark=1291 --diag_remark=682  --diag_error=23 --diag_error=63 --diag_error=64 --diag_error=70 --diag_error=125 --diag_error=145 --diag_error=169 --diag_error=190 --diag_error=194 --diag_error=225 --diag_error=231 --diag_error=261 --diag_error=515 --diag_error=827 --diag_error=994 --display_error_number --emit_warnings_as_errors --asm_listing -DGIT_HASH64=${a_64_bit_hash}   -I${internal_includes} -c ${basename}.c

  • Unfortunately, I still cannot reproduce the problem.  For the problem to show itself, it probably requires a long chain of things to be in a very particular order.  So, one more time, please submit a test case.  This time, carefully follow all the instructions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George