Virtual modifier explicit mapping is limited to platform-dependent int size #594
Labels
compile-keymap
Indicates a need for improvements or additions to keymap compilation
Milestone
Originally posted by @wismill in #450 (comment)
There is a limitation though: the numeric values
ExprInteger::ival
areint
and depending on the target compiler/platform it may not be big enough to hold the mask. Agreed, nowadays on most cases we should havesizeof(int) * CHAR_BIT >= 32
, but the C standard guarantee only 16 bits. Such overflow would be completely silent and difficult to debug. Note that overflow is still possible and silent with the current implementation with 32-bits ints: e.g.virtual_modifiers PureVirtual = 0xffffffff + 1
;So we may want to switch
ExprInteger::ival
fromint
to the explicitint32_t
, which should be plenty enough.The text was updated successfully, but these errors were encountered: