Increase TStorageQualifier bitfield width
Fix #3538. Visual Studio 2022 added a new warning to detect when enumerators can not be represented within the given bit field width. This warning is disabled by default but can be enabled using the flag /w15249. This PR increases the width by one to accommodate the signed maximum value of EvqLast, which is currently 32. Perhaps a future improvement would be to use scoped enums; however, that is more work as the typing is more strict and would require more changes.
This commit is contained in:
parent
bada5c87ec
commit
e7d4ad91a9
1 changed files with 2 additions and 1 deletions
|
|
@ -573,7 +573,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* semanticName;
|
const char* semanticName;
|
||||||
TStorageQualifier storage : 6;
|
TStorageQualifier storage : 7;
|
||||||
|
static_assert(EvqLast < 64, "need to increase size of TStorageQualifier bitfields!");
|
||||||
TBuiltInVariable builtIn : 9;
|
TBuiltInVariable builtIn : 9;
|
||||||
TBuiltInVariable declaredBuiltIn : 9;
|
TBuiltInVariable declaredBuiltIn : 9;
|
||||||
static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!");
|
static_assert(EbvLast < 256, "need to increase size of TBuiltInVariable bitfields!");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue