You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Warning C33010: Unchecked lower bound for enum 'enum' used as index.
15
+
> Unchecked lower bound for enum '\**enum_name*' used as index.
16
16
17
-
This warning is triggered for an enum that is used as an index into an array,
18
-
if the upper bound is checked for its value, but not the lower bound.
17
+
This warning is triggered if an enum is both used as an index into an array and isn't checked on the lower bound.
18
+
19
+
## Remarks
20
+
21
+
Code using enumerated types as indexes for arrays will often check for the upper bound in order to ensure the index is not out of range. Because an enum variable is signed by default, it can have a negative value. If it is used as an index into an array of values or an array of function pointers, a negative value can allow arbitrary memory to be read, used, or even executed.
0 commit comments