Compiling WiredTiger with strict mode leads to the following error:
In file included from /home/hari/work/code/wiredtiger/src/include/wt_internal.h:402, from /home/hari/work/code/wiredtiger/src/reconcile/rec_write.c:9: /home/hari/work/code/wiredtiger/src/reconcile/rec_write.c: In function '__wt_reconcile': /home/hari/work/code/wiredtiger/src/include/hardware.h:51:72: error: unsigned conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} changes the value of '-3' [-Werror=sign-conversion] 51 | } while (!__wt_atomic_cas16(&(p)->flags_atomic, __orig, __orig & ~((uint16_t)(mask)))); \ | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~ /home/hari/work/code/wiredtiger/src/reconcile/rec_write.c:101:5: note: in expansion of macro 'F_CLR_ATOMIC_16' 101 | F_CLR_ATOMIC_16(ref->page, WT_PAGE_COMPACTION_WRITE); | ^~~~~~~~~~~~~~~
Changing it according to the following code fixed the issue.
do { \ __orig = (p)->flags_atomic; \ - } while (!__wt_atomic_cas16(&(p)->flags_atomic, __orig, __orig & ~(uint16_t)(mask))); \ + } while (!__wt_atomic_cas16(&(p)->flags_atomic, __orig, __orig & (uint16_t)(~(mask)))); \ } while (0)
- is duplicated by
-
WT-10281 failed: compile on rhel8-ppc [wiredtiger-mongo-v6.0 @ b53bacaa]
- Closed