COVESA/capicxx-core-tools

Enums generate code with uint8_t type even if enumerated values are greater than 255

srl100 opened this issue · 0 comments

When processing a .fidl file with the following content:
package commonapi.examples

interface enum_test {

	version { major 1 minor 2 }

	enumeration testEnum {
		ZERO=0
		ONE=1
		PROBLEM=256
	}
}

I get generated code that includes invalid values for the enumerated type:

    struct testEnum : CommonAPI::Enumeration< uint8_t> {
        enum Literal : uint8_t {
            ZERO = 0,
            ONE = 1,
            PROBLEM = 256
        };

A value of 256 will not fit into a uint8_t type!

enum_fidl.txt
enum_test_.hpp.txt