Closed
Description
When we use set type in a scheme with uint64 encoding type:
<set name="FlagsSet" encodingType="uint64">
<choice name="Bit0" description="Bit 0">0</choice>
<choice name="Bit35" description="Bit 35">35</choice>
</set>
sbe-all generates CPP code like this:
static bool bit35(const std::uint64_t bits)
{
return (bits & (1u << 35u)) != 0;
}
which causes warning in gcc:
FlagsSet.h:255:31: warning: left shift count >= width of type [-Wshift-count-overflow]
return (bits & (1u << 35u)) != 0;
Here is the value of right operand - 35u is greater to the number of bits in the left operand 1u - 32 bits.
Could somebody help to fix it, please?
Metadata
Metadata
Assignees
Labels
No labels