extint

How do you use clang's new custom size int feature?

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-22 14:12:43
问题 Recently, I heard that clang got a new feature, _ExtInt . I know that it lets you specify the size of an integer (odd or even like 13-bit int), but how do you use it? 回答1: _ExtInt is to be used as a normal specifier. For example: _ExtInt(13) foo; Here you declared foo to be of 13 bits. Remember to not put short or long type of keywords before it (cause it wouldn't really make sense), though you can put signed or unsigned ( signed is default). Note that you aren't allowed to do things like;

How do you use clang's new custom size int feature?

喜夏-厌秋 提交于 2020-07-22 14:12:09
问题 Recently, I heard that clang got a new feature, _ExtInt . I know that it lets you specify the size of an integer (odd or even like 13-bit int), but how do you use it? 回答1: _ExtInt is to be used as a normal specifier. For example: _ExtInt(13) foo; Here you declared foo to be of 13 bits. Remember to not put short or long type of keywords before it (cause it wouldn't really make sense), though you can put signed or unsigned ( signed is default). Note that you aren't allowed to do things like;