The `flags.py` script automatically generates values used for flags in WT structures and parameters.
We should enhance this script to detect when more flags have been specified than will fit in the space where they will be stored.
donald.anderson suggested that we add a parameter to the markers for automatic flag generation:
/* AUTOMATIC FLAG VALUE GENERATION START: MIN=0x100 */ #define ... /* AUTOMATIC FLAG VALUE GENERATION STOP: MAX=0xffff */
MIN and MAX would specify the smallest and largest flags that can be used and might reasonably default to the values for 32-bit flag words.
Something like this would solve several problems:
- Specifying more flags than the size of the flag word (e.g., 10 flags in an 8-bit flag word).
- Enforcing limits in places where we want fewer flags than the flag word would allow. The one example I know of this is in dhandle.h (see
WT-7519). - Automatically generating the flags for WT_BTREE, which currently have to be filled in by hand because they don't start at 0.
- is related to
-
WT-7519 Fix flags field overflow in WT_DATA_HANDLE
- Closed