The F_XXX flags macros cast their arguments to (uint32_t), which will potentially hide errors where the flags constants are too large for the field in which they're being stored, that is, if we use F_SET to turn on a 64-bit flag in a 32-bit field, we won't get an error.
Separately, there's been a related discussion about clang-tidy: the clang-tidy tool doesn't like bitwise operations on signed types. It's coming from CERT, I suspect. We could turn off those warnings, but to "fix" them means all of our flags have to be declared unsigned. In other words, this code gets complaints because flags are signed:
WT_ERR(__wt_tree_walk_custom_skip(session, &ref, __wt_compact_page_skip, NULL, WT_READ_NO_GEN | WT_READ_WONT_NEED));
I suggest we:
- Change all of our hex flags to be declared with a trailing 'u' to force them to be unsigned
- Remove the (uint32_t) casts from the flags macros
- Remove the 64-bit variants of the flags macros, we no longer need them.
alexander.gorrod, thoughts?
- related to
-
WT-3716 Restore the WT_VERB_TEMPORARY verbose flag.
- Closed
- links to