Emboss generates enums declared as uint64_t regardless of how many enum members are present or their ranges. When writing into structure fields, Emboss checks whether there are enough bytes to write without any loss of data.
For example, take the following enum definition:
enum OpCodeGroup:
FOO = 0x08
Emboss generates the following code for the above definition:
enum class OpCodeGroup : ::std::uint64_t;
enum class OpCodeGroup : ::std::uint64_t {
FOO = static_cast</**/::std::int32_t>(8LL),
};
There is only a single element in the enum and its range should easily fall within the range limits of a uint8_t. There is seemingly no way to control the generated size of an enum.
Potential Implementation
The .emb language syntax is updated to accept the maximum size in bytes for an enum in the generated code.
Emboss generates enums declared as uint64_t regardless of how many enum members are present or their ranges. When writing into structure fields, Emboss checks whether there are enough bytes to write without any loss of data.
For example, take the following enum definition:
Emboss generates the following code for the above definition:
There is only a single element in the enum and its range should easily fall within the range limits of a
uint8_t
. There is seemingly no way to control the generated size of an enum.Potential Implementation The
.emb
language syntax is updated to accept the maximum size in bytes for an enum in the generated code.