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.

Setting --small_enum for C6000 compiler in CCS

Hi,

The C6000 compiler supports a --small_enum option to use the smallest possible type for an enumeration (see spru187u,section 2.3.3).

I cannot find where this can be set in the CCS user interface.

Is there a way to set this via the CCS project options or do we have to use an external command file?

Thanks

Nigel

  • Nigel,

    I looked through the options in the GUI but couldn't see that one exposed.  What you can do is go the top level compiler options.  At the bottom right is a button called "Set Additional Flags...".  Click on that and add --small_enum

    Regards,

    John

  • Hi John,

    Thanks, does the trick nicely.

    Cheers

    Nigel
  • Nigel Paton said:
    Is there a way to set this via the CCS project options or do we have to use an external command file?

    My understanding is that CCS runs the compiler with the --help option, where the --help option causes the compiler to report the available options, and CCS parses the available options to automatically populate the available CCS project properties for the compiler version in use by the project.

    When running cl6x.exe --help from C6000 CGT v7.4.16, the C6000 compiler help doesn't list the --small_enum option, which is why the --small_enum option doesn't appear in the CCS project properties. The C6000 compiler doesn't reject the --small_enum option, so guess this is a bug in the C6000 compiler help not reporting the --small_enum option as available. Rather than having to use an external command file, one option is to use the CCS Project Properties Build -> C6000 Compiler -> Set Additional Flags and manually add --small_enum to the compiler flags. With CCS 6.1.1 I checked that this passed the --small_enum option to the C6000 Compiler, but didn't verify the effect of the option on the generated code.

    [Where as running cl430.exe --help from MSP430 CGT v4.4.5 the MSP430 compiler help did list the --small_enum option, and CCS showed the --small_enum option in the MSP430 Compiler Runtime Model Options]