Skip to content
New issue

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

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

Already on GitHub? # 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 · 2 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
@DKSH10
Copy link

DKSH10 commented Nov 25, 2024

Hello,
Any resolution to the issue?

@tech-why
Copy link

tech-why commented Dec 6, 2024

It's the same problem for me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants