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:
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?