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.

c28x, cgtools 5.2.10: issue warning if bitfield initialization results in truncation

For the following code

typedef struct {
  Uint16 a:2;
  Uint16 b:10;
  Uint16 c:4;
} abc_type;

abc_type abc = { 5, 17, 2};

Uint16 foo = 123456;

I get the (very helpful) warning

"con_init.c", line 206: warning #70-D: integer conversion resulted in
          truncation

  Uint16 foo = 123456;
               ^

Unfortunately, the initialization of abc.a with 5 goes wrong without any compiler message.

Is there a way to make the compiler issue a warning or even an error if the initializer of a bitfield doesn't fit into the bitfield?

Regards

Johannes