Closed yl0727 closed 3 years ago
Ah I see, thanks for reporting.
@yl0727 Could you please this branch https://github.com/dvidelabs/flatcc/tree/enumrange
I have only tested that it doesn't break anything, not that it fixes your issue.
I think I made small mistake - the source comment suggests the type coercion call should also work for auto-increment, but it was placed inside a branch that only executed for assigned values. So basically I just moved a bracket:
https://github.com/dvidelabs/flatcc/commit/f4ec267ae043dd35cb3965d7b1232a6eee034799
Merging enumrange branch to master and closing this issue.
Blocking of enumeration value out-of-bounds: When assigning values to enumeration members, flatcc only intercepts the members that are actively assigned but ignores the members that follow the enumeration. For example, if you assign 255 to the first member of the enum of the uint8 type, the second member is 256, which exceeds the maximum value 255.