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.

CCS/TM4C129XKCZAD: char enum support

Expert 1635 points

Part Number: TM4C129XKCZAD

Tool/software: Code Composer Studio

The advanced option that used to be in CCS v6 for byte-sized enums for C++ is not there anymore and trying to do something like:

enum class ui_cmd_id_t : char { LOAD_FORM, UPD_PARAM, SHOW_WARNING };

produces an error.

Is there any support for char enums or that has been removed? Thanks.

Pibe

  • I'm not sure this has ever been supported by the TI ARM compiler.  When you get this line to build clean, what version of the compiler do you use?  And please show all the build options exactly as the compiler sees them.

    Thanks and regards,

    -George

  • You may be right, George. I probably had the MSP430 C++ compiler in my mind.
    So, no char enum until C++11 support?
    Pibe
  • I can confirm that the option still exist in CCSv7, although under Runtime Model Options for both platforms, MSP430 and Cortex-M (with differences though):

    MSP430:

    ARM:

    Pibe

  • I found in ARM Optimizing C/C++ Compiler v17.3.0.STS, section 5.5.1, that using --small_enum option will produce byte-sized enums if values allow for it.
    Pibe
  • Even when you use --small_enum, this source line ...

    Pibe said:
    enum class ui_cmd_id_t : char { LOAD_FORM, UPD_PARAM, SHOW_WARNING };

    ... is not accepted.  I thought you had somehow found a way to have the TI ARM compiler accept that.

    Thanks and regards,

    -George

  • Oh, now I understand your question, George. I phrased my case poorly.

    What I meant was that I remembered setting some time ago (it turned out to be 2+ years, on an MSP430 project) some enum-related option (which I thought it was on Language options but it was in the Runtime Model Options section) to get byte-sized enums. I could not find that option initially for the Tiva.

    Then, and because I could not find another way, I tried the C++11 syntax, which did not work either. I have not used that syntax before.

    I finally found the --small_enum option and it works as expected.

    Thank you for looking into this and sorry for the confusion.

    Regards,

    Pibe