Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srl100 opened this issue Apr 4, 2024 · 0 comments

Comments

@srl100
Copy link

srl100 commented Apr 4, 2024

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

@srl100 srl100 changed the title Enums use uint8_t type even if enumerated values will not fit Enums generate code with uint8_t type even if enumerated values are greater than 255 Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant