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.

C6000 compiler doesn't report the --small_enum option in the output of cl6x --help

The C6000 compiler v8.0.4 accepts the --small_enum option, as demonstrated by the following example in which sizeof (sequence_enum) is 4 without --small_enum and 1 with --small_enum:

typedef enum
{
    SEQUENCE_A,
    SEQUENCE_B,
    SEQUENCE_C
} sequence_enum;

int main(void) {
	
	return sizeof (sequence_enum);
}

However --small_enum isn't reported when cl6x --help is run, which means the --small_enum option isn't shown in the CCS project properties. The work-around is to add --small_enum in the CCS Project Properties by CCS Build -> C6000 Compiler -> Set Additional Flags.

For reference, this was first noticed in https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/472985

  • It is actually a mistake that --small_enum remains in the manual.  It was supposed to be removed. 

    This does not cause any problems for very simple builds that only use the compiler RTS library.  That library does not use any enum types, and thus can link with code built with or without --small_enum.  But what about other object libraries, such as BIOS, dsplib, and so on?  I'm certain none of those libraries are built with --small_enum.  But I am unsure about whether they use any enumerated types, and thus cannot be combined with code built with --small_enum.

    Thanks and regards,

    -George

  • I discovered that BIOS does not work with code built with --small_enum.  It is probably the same with many other object code libraries. 

    Thanks and regards,

    -George

  • George Mock said:
    It is actually a mistake that --small_enum remains in the manual.  It was supposed to be removed. 

    Thanks for the clarification.

    Does that only apply to the C6000 compiler, or should --small_enum not be mentioned for other compilers as well?

    e.g. 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

  • Chester Gillon said:
    Does that only apply to the C6000 compiler

    Yes.  -George