-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
I think I noticed a potential typo in the stdbit type generic macros for stdc_bit_width and stdc_bit_floor:
#define stdc_bit_width(x) \
_Generic((x), \
unsigned char: stdc_bit_width_ui, <--- \
unsigned short: stdc_bit_width_us, \
unsigned: stdc_bit_width_ui, \
unsigned long: stdc_bit_width_ul, \
unsigned long long: stdc_bit_width_ull)(x)
#define stdc_bit_floor(x) \
_Generic((x), \
unsigned char: stdc_bit_floor_ui, <--- \
unsigned short: stdc_bit_floor_us, \
unsigned: stdc_bit_floor_ui, \
unsigned long: stdc_bit_floor_ul, \
unsigned long long: stdc_bit_floor_ull)(x)
I think the assignment exprs for the assocs for unsigned char should refer to the respective *_uc functions.
Seems like this is missed by the tests because we only test the __cplusplus part of the preprocessor conditional.
I will fix these and add tests for both branches of the preprocessor conditional in stdbit-macros.h, let me know if these are actually as expected.